Classes | |
class | Aseba::Switch |
Functions | |
void | Aseba::Switch::broadcastDummyUserMessage () |
virtual void | Aseba::Switch::connectionClosed (Dashel::Stream *stream, bool abnormal) |
virtual void | Aseba::Switch::connectionCreated (Dashel::Stream *stream) |
virtual void | Aseba::Switch::incomingData (Dashel::Stream *stream) |
Aseba::Switch::Switch (unsigned port, bool verbose, bool dump, bool forward, bool rawTime) | |
Broadcast messages form any data stream to all others data streams including itself. |
void Aseba::Switch::broadcastDummyUserMessage | ( | ) | [inherited] |
Send a dummy user message to all connected pears.
Definition at line 121 of file switch.cpp.
void Aseba::Switch::connectionClosed | ( | Dashel::Stream * | , | |
bool | ||||
) | [private, virtual, inherited] |
Called when target closes connection. The only valid method to call on the stream is getTargetName(), input/output operations are forbidden. You must not call closeStream(stream) from within this method for the same stream as the one passed as parameter. Subclass can implement this method. Called with the stream lock held.
stream | stream to the target. | |
abnormal | whether the connection was closed during step (abnormal == false) or when an operation was performed (abnormal == true) |
Reimplemented from Dashel::Hub.
Definition at line 109 of file switch.cpp.
void Aseba::Switch::connectionCreated | ( | Dashel::Stream * | ) | [private, virtual, inherited] |
Called when any data connection is created. It is not called when a listening connection (eg tcpin:) is created. If the stream is closed during this method, an exception occurs: the caller is responsible to handle it. The stream is already inserted in the stream list when this function is called. Subclass can implement this method. Called with the stream lock held.
stream | stream to the target |
Reimplemented from Dashel::Hub.
Definition at line 55 of file switch.cpp.
void Aseba::Switch::incomingData | ( | Dashel::Stream * | ) | [private, virtual, inherited] |
Called when data is available for reading on the stream. If the stream is closed during this method, an exception occurs: Hub stops the execution of this method and calls connectionClosed(); objects dynamically allocated must thus be handled with auto_ptr. If step() is used, subclass must implement this method and call read at least once. Called with the stream lock held.
stream | stream to the target |
Reimplemented from Dashel::Hub.
Definition at line 64 of file switch.cpp.
Aseba::Switch::Switch | ( | unsigned | port, | |
bool | verbose, | |||
bool | dump, | |||
bool | forward, | |||
bool | rawTime | |||
) | [inherited] |
Broadcast messages form any data stream to all others data streams including itself.
Creates the switch, listen to TCP on port.
verbose | should we print a notification on each message | |
dump | should we dump content of each message | |
forward | should we only forward messages instead of transmit them back to the sender |
Definition at line 41 of file switch.cpp.