class MessageTransceiverThread (Return to index)

This is a utility class to help interface multithreaded BeOScode more easily to a TCP socket that is sending and receivingPortableMessages. Only compiles under BeOS!

Type:
    Instantiable

Include file:
    ../../besupport/MessageTransceiverThread.h

It helps by allowing you to send and receive PortableMessages without having to worry about calling select(), or any blocking issues. Usage: 1. Create a new MessageTransceiverThread object. 2. Call StartThread(), StartAcceptThread(), or StartConnectThread(). 3. Whenever you wish to send a PortableMessage over the TCP socket, simply call SendOutgoingMessage(). 4. Whenever a PortableMessage is received, a PORTABLE_MESSAGES_RECEIVED BMessage will be sent to the BMessenger you specified in StartThread(). When you get this, you can respond by calling GetNextIncomingThread() on this object to retrieve the PortableMessage. 5. When you are done, just delete this object normally. If you wish, you can call WaitForAllMessagesToBeSent() first, in order to ensure that all pending outbound messages get delivered. 6. That's it!

Synopsis:

Public methods: