FireVision FUSE protocol server. More...
#include <>>
Public Member Functions | |
FuseServer (unsigned short int port, fawkes::ThreadCollector *collector=NULL) | |
Constructor. | |
virtual | ~FuseServer () |
Destructor. | |
virtual void | add_connection (fawkes::StreamSocket *s) throw () |
Add an incoming connection. | |
void | connection_died (FuseServerClientThread *client) throw () |
Connection died. | |
virtual void | loop () |
Code to execute in the thread. |
FireVision FUSE protocol server.
The FuseServer will open a StreamSocket and listen on it for incoming connections. For each connection a client thread is started that will process all requests issued by the client.
Definition at line 43 of file fuse_server.h.
firevision::FuseServer::FuseServer | ( | unsigned short int | port, | |
fawkes::ThreadCollector * | collector = NULL | |||
) |
Constructor.
port | Port to listen on for incoming connections | |
collector | optional thread collector |
Definition at line 54 of file fuse_server.cpp.
References fawkes::ThreadCollector::add(), and fawkes::Thread::start().
firevision::FuseServer::~FuseServer | ( | ) | [virtual] |
Destructor.
Definition at line 69 of file fuse_server.cpp.
References fawkes::Thread::cancel(), fawkes::Thread::join(), and fawkes::ThreadCollector::remove().
void firevision::FuseServer::add_connection | ( | fawkes::StreamSocket * | s | ) | throw () [virtual] |
Add an incoming connection.
This is called for instance by the NetworkAcceptorThread whenever a new connection has been accepted.
s | socket for new connection |
Implements fawkes::NetworkIncomingConnectionHandler.
Definition at line 95 of file fuse_server.cpp.
References fawkes::Thread::start().
void firevision::FuseServer::connection_died | ( | FuseServerClientThread * | client | ) | throw () |
Connection died.
client | client whose connection died |
Definition at line 111 of file fuse_server.cpp.
Referenced by firevision::FuseServerClientThread::loop(), firevision::FuseServerClientThread::recv(), and firevision::FuseServerClientThread::send().
void firevision::FuseServer::loop | ( | ) | [virtual] |
Code to execute in the thread.
Implement this method to hold the code you want to be executed continously. If you do not implement this method, the default is that the thread will exit. This is useful if you choose to only implement once().
Reimplemented from fawkes::Thread.
Definition at line 119 of file fuse_server.cpp.
References fawkes::LockList< Type >::lock(), fawkes::ThreadCollector::remove(), and fawkes::LockList< Type >::unlock().