You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2011/03/19 16:38:29 UTC
[jira] Created: (NET-382) Subclasses of SocketClient should use
_input_ and _output_ rather than calling _socket_.getInputStream() etc
Subclasses of SocketClient should use _input_ and _output_ rather than calling _socket_.getInputStream() etc
------------------------------------------------------------------------------------------------------------
Key: NET-382
URL: https://issues.apache.org/jira/browse/NET-382
Project: Commons Net
Issue Type: Bug
Reporter: Sebb
SocketClient._connectAction() sets up _input_ and _output_ from _socket_ so it is wasteful to do this again in subclasses.
Potentially consider making _socket_ private?
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (NET-382) Subclasses of SocketClient should use
_input_ and _output_ rather than calling _socket_.getInputStream() etc
Posted by "Bogdan Drozdowski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/NET-382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bogdan Drozdowski updated NET-382:
----------------------------------
Attachment: sockclient-socket-private.diff
I thought about that this too one day. Now I have a patch. It allows the user to get the current socket, set a new one (automatically updating _input and _output) and get the current streams. If accepted, _socket, _input and _output can be made private and the subclasses modified to fit the new interface. This will force the subclasses to use _input and _output. It still is one call, but this time the call simply returns a field.
I don't like getSocket(), but it's required by classes that can, for example, switch between encrypted and plain-text modes (like FTPSClient) to save to original socket. Better than relying on a field name, anyway. The classes that inherit from SocketClient still can modify the Socket the way they like, so it's no worse than what it's like currently.
BufferedReaders/Writers are subclass-specific, so they can't be set automatically when changing the socket. But it's probably useless to have them in a general-purpose socket class, since they could be unused. So it's probably best to leave things as they are: let the subclasses worry about these.
> Subclasses of SocketClient should use _input_ and _output_ rather than calling _socket_.getInputStream() etc
> ------------------------------------------------------------------------------------------------------------
>
> Key: NET-382
> URL: https://issues.apache.org/jira/browse/NET-382
> Project: Commons Net
> Issue Type: Bug
> Reporter: Sebb
> Attachments: sockclient-socket-private.diff
>
>
> SocketClient._connectAction() sets up \_input\_ and \_output\_ from \_socket\_ so it is wasteful to do this again in subclasses.
> Potentially consider making \_socket\_ private?
> However, this would currently break most of the "S" versions of the protocols, unless SocketClient is extended to handle their needs.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (NET-382) Subclasses of SocketClient should use
_input_ and _output_ rather than calling _socket_.getInputStream() etc
Posted by "Sebb (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/NET-382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sebb updated NET-382:
---------------------
Issue Type: Improvement (was: Bug)
> Subclasses of SocketClient should use _input_ and _output_ rather than calling _socket_.getInputStream() etc
> ------------------------------------------------------------------------------------------------------------
>
> Key: NET-382
> URL: https://issues.apache.org/jira/browse/NET-382
> Project: Commons Net
> Issue Type: Improvement
> Reporter: Sebb
> Attachments: sockclient-socket-private.diff
>
>
> SocketClient._connectAction() sets up \_input\_ and \_output\_ from \_socket\_ so it is wasteful to do this again in subclasses.
> Potentially consider making \_socket\_ private?
> However, this would currently break most of the "S" versions of the protocols, unless SocketClient is extended to handle their needs.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (NET-382) Subclasses of SocketClient should use
_input_ and _output_ rather than calling _socket_.getInputStream() etc
Posted by "Sebb (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/NET-382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sebb updated NET-382:
---------------------
Description:
SocketClient._connectAction() sets up \_input\_ and \_output\_ from \_socket\_ so it is wasteful to do this again in subclasses.
Potentially consider making \_socket\_ private?
However, this would currently break most of the "S" versions of the protocols, unless SocketClient is extended to handle their needs.
was:
SocketClient._connectAction() sets up _input_ and _output_ from _socket_ so it is wasteful to do this again in subclasses.
Potentially consider making _socket_ private?
> Subclasses of SocketClient should use _input_ and _output_ rather than calling _socket_.getInputStream() etc
> ------------------------------------------------------------------------------------------------------------
>
> Key: NET-382
> URL: https://issues.apache.org/jira/browse/NET-382
> Project: Commons Net
> Issue Type: Bug
> Reporter: Sebb
>
> SocketClient._connectAction() sets up \_input\_ and \_output\_ from \_socket\_ so it is wasteful to do this again in subclasses.
> Potentially consider making \_socket\_ private?
> However, this would currently break most of the "S" versions of the protocols, unless SocketClient is extended to handle their needs.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (NET-382) Subclasses of SocketClient should use
_input_ and _output_ rather than calling _socket_.getInputStream() etc
Posted by "Bogdan Drozdowski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/NET-382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bogdan Drozdowski updated NET-382:
----------------------------------
Attachment: sockclient-socket-private.diff
Sorry, the attachment had an error. Now fixed and attached again.
> Subclasses of SocketClient should use _input_ and _output_ rather than calling _socket_.getInputStream() etc
> ------------------------------------------------------------------------------------------------------------
>
> Key: NET-382
> URL: https://issues.apache.org/jira/browse/NET-382
> Project: Commons Net
> Issue Type: Bug
> Reporter: Sebb
> Attachments: sockclient-socket-private.diff
>
>
> SocketClient._connectAction() sets up \_input\_ and \_output\_ from \_socket\_ so it is wasteful to do this again in subclasses.
> Potentially consider making \_socket\_ private?
> However, this would currently break most of the "S" versions of the protocols, unless SocketClient is extended to handle their needs.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (NET-382) Subclasses of SocketClient should use
_input_ and _output_ rather than calling _socket_.getInputStream() etc
Posted by "Bogdan Drozdowski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/NET-382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bogdan Drozdowski updated NET-382:
----------------------------------
Attachment: (was: sockclient-socket-private.diff)
> Subclasses of SocketClient should use _input_ and _output_ rather than calling _socket_.getInputStream() etc
> ------------------------------------------------------------------------------------------------------------
>
> Key: NET-382
> URL: https://issues.apache.org/jira/browse/NET-382
> Project: Commons Net
> Issue Type: Bug
> Reporter: Sebb
>
> SocketClient._connectAction() sets up \_input\_ and \_output\_ from \_socket\_ so it is wasteful to do this again in subclasses.
> Potentially consider making \_socket\_ private?
> However, this would currently break most of the "S" versions of the protocols, unless SocketClient is extended to handle their needs.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira