commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject [NET] TelnetClient without reader thread for FTPClient
Date Wed, 23 Apr 2003 17:07:03 GMT
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 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
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. 


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message