Re: [Beepcore-java-users] About BEEP output and input stream
Status: Beta
Brought to you by:
huston
From: Kevin K. <kk...@my...> - 2002-08-06 21:38:22
|
If you do not want to wait for message to come back then you could create a thread for sending out the messages and register your own implementation "ReplyListener" for the sendMSG() call that could handle the messages for you. Not exactly sure if this is what you had in mind though. Not sure what you mean by "independent InputStream". Hope that helps, --Kevin Kress On Tue, 2002-08-06 at 14:20, Russell Hung wrote: > Hi, > > I have a question about the input and output stream of BEEP. I read the > example on the book, "BEEP", written by Dr. Marshall T. Rose and > published by O'Reilly. There is a client example on page 52: > > try { > channel.sendMSG(new StringOutputDataStream(request), reply); > } catch { ....} > > InputDataStream ds = reply.getNextReply().getDataStream(); > InputStream is = ds.getInputStream(); > > while(is.read() != -1) { > ++replyLength; > } > > It uses the message reply object to get the input stream. That means we > have to send a message and wait for the response. This is not what I > want. What I need are two independent threads: one for listening to the > port/messages and one for sending out the message through the port. Is > there any way to have an independent InputStream? Thanks. > > Best Regards, > > Russell Hung > rh...@vi... > -- Kevin Kress kk...@my... GnuPG Key ID: 92949032 Fingerprint : B7F9 2B08 6FC8 35CA 5B64 BD34 6A8B 325C 9294 9032 See Keyserver: http://www.keyserver.net/en/findkey.html (search for "Kevin Kress" or "0x92949032") Get GnuPG or PGP at http://www.pgpi.org |