#include <netclient.h>
Inheritance diagram for oxygen::NetClient:
Public Member Functions | |
NetClient () | |
virtual | ~NetClient () |
void | SetServer (const std::string &host) |
sets the server to connect to | |
const std::string & | GetServer () const |
returns the server this client connects to | |
void | SetPort (int port) |
sets the port to connect to | |
int | GetPort () const |
returns the port this client connects to | |
void | SetClientType (oxygen::NetControl::ESocketType type) |
sets the client socket type | |
oxygen::NetControl::ESocketType | GetClientType () |
returns the client socket type | |
void | SendMessage (const std::string &msg) |
prepares the message with the registered NetMessage instance and sends it to the server | |
Protected Member Functions | |
bool | Connect () |
tries to connect to the server, returns true on success | |
void | ReadFragments () |
reads all pending message fragments from the server and stores them in the mNetBuffer | |
void | CloseConnection () |
closes connection to the server | |
void | ParseMessage (const std::string &msg) |
parses a received message | |
Protected Attributes | |
std::string | mHost |
the host name of the server | |
int | mPort |
the monitor port to connect to | |
oxygen::NetControl::ESocketType | mType |
the socket type to create | |
boost::shared_ptr< rcss::net::Socket > | mSocket |
the managed TCP socket | |
boost::shared_ptr< oxygen::NetBuffer > | mNetBuffer |
the receive buffer | |
boost::shared_ptr< oxygen::NetMessage > | mNetMessage |
the registered message protocol | |
int | mBufferSize |
the size of the allocated receive buffer | |
boost::shared_array< char > | mBuffer |
the receive buffer |
Definition at line 36 of file netclient.h.
|
Definition at line 35 of file netclient.cpp. References mBuffer, mBufferSize, mHost, mNetBuffer, mPort, mType, and oxygen::NetControl::ST_TCP. |
|
Definition at line 45 of file netclient.cpp. |
|
closes connection to the server
Definition at line 179 of file netclient.cpp. References zeitgeist::Object::GetLog(), zeitgeist::Leaf::GetName(), mHost, mNetMessage, mPort, and mSocket. Referenced by SparkMonitorClient::DoneSimulation(), and ReadFragments(). Here is the call graph for this function: ![]() |
|
tries to connect to the server, returns true on success
Definition at line 79 of file netclient.cpp. References zeitgeist::Object::GetLog(), zeitgeist::Leaf::GetName(), mHost, mNetMessage, mPort, mSocket, mType, and oxygen::NetControl::ST_UDP. Referenced by SparkMonitorClient::InitSimulation(). Here is the call graph for this function: ![]() |
|
returns the client socket type
Definition at line 74 of file netclient.cpp. References mType. |
|
returns the port this client connects to
Definition at line 64 of file netclient.cpp. References mPort. |
|
returns the server this client connects to
Definition at line 54 of file netclient.cpp. References mHost. |
|
parses a received message
Reimplemented in SparkMonitorClient. |
|
reads all pending message fragments from the server and stores them in the mNetBuffer
Definition at line 196 of file netclient.cpp. References CloseConnection(), zeitgeist::Object::GetLog(), zeitgeist::Leaf::GetName(), mBuffer, mBufferSize, mNetBuffer, and mSocket. Referenced by SparkMonitorClient::StartCycle(). Here is the call graph for this function: ![]() |
|
prepares the message with the registered NetMessage instance and sends it to the server
Referenced by SparkMonitorClient::InitSimulation(). |
|
sets the client socket type
Definition at line 69 of file netclient.cpp. References mType. |
|
sets the port to connect to
Definition at line 59 of file netclient.cpp. References mPort. |
|
sets the server to connect to
Definition at line 49 of file netclient.cpp. References mHost. |
|
the receive buffer
Definition at line 102 of file netclient.h. Referenced by NetClient(), and ReadFragments(). |
|
the size of the allocated receive buffer
Definition at line 99 of file netclient.h. Referenced by NetClient(), and ReadFragments(). |
|
the host name of the server
Definition at line 81 of file netclient.h. Referenced by CloseConnection(), Connect(), GetServer(), NetClient(), and SetServer(). |
|
the receive buffer
Definition at line 93 of file netclient.h. Referenced by NetClient(), ReadFragments(), and SparkMonitorClient::StartCycle(). |
|
the registered message protocol
Definition at line 96 of file netclient.h. Referenced by CloseConnection(), Connect(), and SparkMonitorClient::StartCycle(). |
|
the monitor port to connect to
Definition at line 84 of file netclient.h. Referenced by CloseConnection(), Connect(), GetPort(), NetClient(), and SetPort(). |
|
the managed TCP socket
Definition at line 90 of file netclient.h. Referenced by CloseConnection(), Connect(), and ReadFragments(). |
|
the socket type to create
Definition at line 87 of file netclient.h. Referenced by Connect(), GetClientType(), NetClient(), and SetClientType(). |