srExternal::TcpipComponent Class Reference

#include <tcpipComponent.h>

Inherited by srAlmende::EvolutionComponent.

List of all members.

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.

Detailed Description

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Todo:
Make receiving TCP/IP message more bullet proof. There should be no way to crash the simulator by just sending wrong id's or other malformed packets.

Reimplemented in srAlmende::EvolutionComponent.

Definition at line 87 of file tcpipComponent.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations

Generated on Thu Feb 4 16:32:08 2010 for Delta3D Plugin by  doxygen 1.6.1