#include <H3DNetworkingUtils/RemoteTCPServer.h>
Public Member Functions | |
RemoteTCPServer () | |
Constructor. | |
virtual | ~RemoteTCPServer () |
Destructor. | |
Static Public Attributes | |
static H3D::H3DNodeDatabase | database |
The X3d interface. | |
Protected Member Functions | |
virtual void | startServer (int port_number) |
Start the server. | |
virtual void | startReceiving () |
Start the receiving thread. | |
virtual void | listeningLoop () |
This function runs in a new thread, to listen for new connections. | |
bool | listeningLoopRunning () |
returns true if the listening loop is running | |
void | setListeningLoopRunning (bool v) |
Start the listening loop. | |
void | stopListeningThread () |
Stop the listening loop. | |
Classes | |
struct | ListenData |
Data for the listening loop to use (A second thread cannot safely read fields used by the graphics thread). More... |
It starts listening on the given port for a connection from a remote client, then continues with the base class's behaviour, using a newly allocate dport for communications. When open is changed from false to true, the listening port is monitored for a connection from a client. When it is changed from true to false, the connection is closed. At present, only one remote connection is handled.
Examples:
RemoteTCPServer::~RemoteTCPServer | ( | ) | [virtual] |
Destructor.
if (listening_threadP) { listening_threadP->cancel(); listening_threadP->wait(); listening_threadP = NULL;
}
References listeningLoopRunning().
void RemoteTCPServer::listeningLoop | ( | ) | [protected, virtual] |
This function runs in a new thread, to listen for new connections.
while (!isShuttingDown()) {
setSendTimeout(sockP, 100);
References H3DNetworkingUtils::RemoteTCPServer::ListenData::port, InetAddr::scanPort(), setListeningLoopRunning(), H3DNetworkingUtils::RemoteConnection::showInfo(), and startReceiving().