Re: [Beepcore-java-users] Message as String
Status: Beta
Brought to you by:
huston
From: Huston <hu...@us...> - 2002-09-03 16:57:54
|
> 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 |