HDK
|
#include <UT_NetMessage.h>
Public Member Functions | |
UT_NetMessagePump () | |
~UT_NetMessagePump () | |
On destruction all messages on our internal lists will be destroyed. More... | |
void | postMessage (UT_NetMessage *msg) |
void | reset () |
Resets, but does not free any messages it has. More... | |
UT_ValArray< UT_NetMessage * > & | completed () |
UT_ValArray< UT_NetMessage * > & | errored () |
void | listenSocket (UT_NetSocket *socket) |
void | stopListening (UT_NetSocket *socket) |
Stops listening from a given socket. More... | |
bool | pumpData (int timeoutms) |
int | pendingMessages () const |
The number of messages still pending. More... | |
void | deleteSentMessages (bool shoulddelete) |
void | receiveAnnounce (bool receiveannounce) |
Protected Attributes | |
bool | myDeleteSent |
bool | myReceiveAnnounce |
UT_ValArray< UT_NetMessage * > | myWorkList |
UT_ValArray< UT_NetMessage * > | myErrorList |
UT_ValArray< UT_NetMessage * > | myCompleteList |
UT_ValArray< UT_NetSocket * > | myServerList |
Interleaves processing from possibly many different message sources.
postMessage() can be used to queue messages to send after their setWriteSocket and setWriteData has been invoked.
listenSocket() will invoke accept() and add to the completed() list messages as they are done.
Definition at line 248 of file UT_NetMessage.h.
UT_NetMessagePump::UT_NetMessagePump | ( | ) |
UT_NetMessagePump::~UT_NetMessagePump | ( | ) |
On destruction all messages on our internal lists will be destroyed.
|
inline |
List of all completed incoming messages.
To process a message from the completed list, UT_NetMessage *msg = pump.completed()(i); pump.completed()(i) = 0; ... use msg ... delete msg;
Definition at line 277 of file UT_NetMessage.h.
|
inline |
Definition at line 301 of file UT_NetMessage.h.
|
inline |
List of messages that have entered the error status. This includes failed outgoing messages as well as incomplete incoming messages.
Definition at line 282 of file UT_NetMessage.h.
void UT_NetMessagePump::listenSocket | ( | UT_NetSocket * | socket | ) |
Starts listening to the given socket for messages We do not own this socket, caller should delete it (but not before stopping listening or deleting the pump!) Connections accepted from this socket will be read via UT_NetMessage's protocol.
|
inline |
The number of messages still pending.
Definition at line 299 of file UT_NetMessage.h.
void UT_NetMessagePump::postMessage | ( | UT_NetMessage * | msg | ) |
Adds the message to our queue to process. We take ownership of the UT_NetMessage until it is removed from one of our lists.
bool UT_NetMessagePump::pumpData | ( | int | timeoutms | ) |
Processes active messages and listens for incoming messages. Returns true if there is the potential of more work - if listening to a socket this is always true!
|
inline |
Definition at line 302 of file UT_NetMessage.h.
Resets, but does not free any messages it has.
Definition at line 263 of file UT_NetMessage.h.
void UT_NetMessagePump::stopListening | ( | UT_NetSocket * | socket | ) |
Stops listening from a given socket.
|
protected |
Definition at line 308 of file UT_NetMessage.h.
|
protected |
Definition at line 304 of file UT_NetMessage.h.
|
protected |
Definition at line 307 of file UT_NetMessage.h.
|
protected |
Definition at line 305 of file UT_NetMessage.h.
|
protected |
Definition at line 309 of file UT_NetMessage.h.
|
protected |
Definition at line 306 of file UT_NetMessage.h.