#include <tcpipComponent.h>
Inherited by srAlmende::EvolutionComponent.
Public Member Functions | |
| TcpipComponent (const std::string &name, int tcpPort) | |
| Constructor. | |
| virtual void | ProcessMessage (const dtGame::Message &message) |
| Handle messages from the GM. | |
Protected Member Functions | |
| virtual | ~TcpipComponent () |
| Destructor. | |
The TCP/IP Component contains references to the actual TCP/IP routines and the transformations from TCP/IP content towards game messages are defined as virtual routines and have to be implemented by subclasses. See for example the file evolutionComponent.h. With this setup everybody is free to define the content of the TCP/IP messages.
Definition at line 38 of file tcpipComponent.h.
| srExternal::TcpipComponent::TcpipComponent | ( | const std::string & | name, | |
| int | tcpPort | |||
| ) |
Constructor.
The constructor only needs a name and a TCP/IP port number. The party on the other side should already be listening or no connection will be set up.
Definition at line 43 of file tcpipComponent.cpp.
| void srExternal::TcpipComponent::ProcessMessage | ( | const dtGame::Message & | message | ) | [virtual] |
Handle messages from the GM.
The tcpipComponent can get at least two types of messages. Game events that tell the component to enable it's TCP/IP streaming or do other stuff in general. And ticks, that tell the component to execute commands from the TCP/IP stream and put values back. This is not a controller! So, there is no data streamed from individual robots to the outside world. There is only one "meta" stream that contains data that is transformed into game events towards robots. There is no N-1 mapping. If individual robots need a TCP/IP stream it should be done with the tcpipController, not the tcpipComponent.
Reimplemented in srAlmende::EvolutionComponent.
Definition at line 87 of file tcpipComponent.cpp.
1.6.1