Re: Message as String

"Huston" <[email protected]> Tue, 3 Sep 2002 10:31:55 -0600
Newsgroups gmane.network.beep.beepcore.java.general
Message-ID <[email protected]>
> When 'receiveMSG' is called, can payload be assumed to have been
> completely received? If not what are the steps client is expected
> to take so that a complete payload is available for processing?
>
> Could you also answer this question w.r.t. ReplyListener's receiveXXX
> methods?

It is the same for both receiveMSG and receiveXXX. The method is called when
the first frame of a message is received. The isComplete() method on
InputDataStream can be used to determine when the last frame is received
(also the waitForNextSegment and read methods will return null and 0
respectfully after the last frame has been 'read').

One thing to note is that if the channel's window fills up, more data will
not be received until the already received data is 'read'. So I would not
recommend waiting until all of the frames have been received before reading
any of the data unless you are absolutely sure that the message will be less
than the window size.

--Huston



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390