Re: beepcore implementation
Jered Floyd <[email protected]> 20 Oct 2003 15:40:03 -0400
| Newsgroups | gmane.ietf.beep |
|---|---|
| Message-ID | <[email protected]> |
> Does beepcore-j limit the size on messages (in particular ANS & RPY). I > recently began using beepcore-j, and initially my messages were roughly > 500 bytes and everything worked very well. The message size has now grown > to about 5k, and after a few messages, the processing stops, as if > receiveANS and receiveRPY are no longer being called. I tried spawning a > new thread to handle read the message input stream, and it didn't seem to > help very much. Do I need to break the messages up into smaller pieces, > or am I doing something else incorrectly? Troy, You probably want the list "[email protected]"; this list is for discussion of the BEEP protocol as opposed to its implementations. That said, the problem is that you will deadlock with the remote peer if you try to read in a complete message with receiveMSG() when it is called, because the thread that calls receiveMSG() is also responsible for sending out SEQs as data is read in to your application. If you ever receive a message that is larger than the channel window buffer size, your application will fail to read it in, waiting for more data that will never come (until you return and let the thread do its housekeeping.) Attached is a message from the beepcore-java-users list regarding this problem; I believe it is the same as you are seeing. --Jered From: Jered Floyd <[email protected]> Subject: Re: [Beepcore-java-users] any solution to handle multiple frames? To: "Cao, Ben P" <[email protected]> Cc: "'[email protected]'" <[email protected]> Date: 13 Sep 2001 15:28:38 -0400 "Cao, Ben P" <[email protected]> writes: > I now have problem with message being sent that is greater than 4K. I > noticed that there is one previous posting and resolution to the problem by > Huston for the next release version of Beep. However, does anyone find a way > to deal with this at all? I am trying to fix it, but unsuccessful. Yes; to work around this for the time being, make sure that the read() on the input streams occurs in a different thread from the SessionThread, which is where receiveMSG() is called. Have your receiveMSG() give the Message object to another thread for processing (i.e. store it in an instance field and notify() to wake a different thread that is wait()ing on the Message, or what-have-you.) Beepcore provides MessageQueue, which may be able to help you here. Register a MessageQueue (instead of your current class) as the MessageListener, and have your class take the Messages from the Queue from a separate thread. --Jered