Re: [JSch-users] Proposal for ChannelListener (was: exec and threads)
Status: Alpha
Brought to you by:
ymnk
From: Holger K. <li...@kl...> - 2005-02-02 14:56:02
|
On Wednesday 02 February 2005 10:51, Eric DECORNOD wrote: > > How about listening for the event at opening or establishing connection, > > and how about monitoring data in inbound and outbound streams? > > There should be many possibilities, but I'm still hesitated to add > > listers. Do you know the reason why JDK API does not have listeners > > for java.net.Socket, java.io.FileInputStream, etc.? > > I'm not a « java guru » but why not considering the use of > java.lang.Object.notifyAll() and java.lang.Object.wait() instead of > callback functions ? While looking at it, I suspect that *Readers and *Writers themsselves should be considered as listeners. That way, what's missing is just a close being sent to the output/err stream of a ChannelExec (other Channels may vary). Patch included :-) > http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#notifyAll() > http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#wait() I just tried that but I don't get the "owner of the monitor" thing right. It's really tough when it comes to GUI threads... Mit freundlichem Gruß / With kind regards Holger Klawitter -- lists <at> klawitter <dot> de |