You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "b.davanzo@inwind.it" <b....@inwind.it> on 2003/04/23 19:07:03 UTC
[NET] TelnetClient without reader thread for FTPClient
Hi to all,
One of the tasks reported in the TODO list for commons net is:
"Divorce FTPClient from TelnetClient, getting rid of the TelnetClient threads which cause problems on some platforms (e.g., MacOS)."
One solution to this problem could be modifying TelnetClient to make the auxiliary reader thread optional.
For example, we could add two new methods:
boolean getReaderThread(): returns the actual setting for this TelnetClient
void setReaderThread(boolean flag): sets thisTelnetClient to start a reader thread (true) or not (false).
This will require some modification to TelnetInputStream to take care of the two different modes for read, one relying on an auxiliary thread, the other one making the actual read on the same thread that is calling the TelnetClient.read() method.
The advantage is that all the protocol management of the original TelnetClient would be reused for this "lightweight" option.
When used without reader thread, TelnetClient won't have the same fast response in managing the protocol (for example, when the other party wants to negotiate an option, TelnetClient will not answer to the negotiation command until the user of TelnetClient calls TelnetClient.read(). This is surely acceptable for FTPClient, where telnet is used just for the command session, not for a very intensive or option-dependent use.
I could take care of modifying TelnetClient as described and post a proposed patch in a week.
An important issue could be trying to have ready a platform (MacOS? I don't know exactly where this problem did come out and which kind of symptoms it was causing) where FTPClient is having problems due to the TelnetClient thread to test if the TelnetClient with no reader thread solves the problem. Maybe we should try to write a JUnit test for FTPClient which is failing using the original TelnetClient and succeeding using the new mode.
Any suggestion or idea regarding this issue will be welcome.
Bye,
Bruno
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org