BALL::TCPServer Class Reference

#include <BALL/SYSTEM/networking.h>

Inheritance diagram for BALL::TCPServer:
BALL::TCPServerThread BALL::VIEW::ServerWidget::BALLViewServer

List of all members.


Public Member Functions

 TCPServer (Size port, bool restart=true)
virtual ~TCPServer ()
virtual void activate ()
virtual void deactivate ()
virtual void startAccepting ()
virtual void handleConnection ()
virtual void connectionRequested ()
void setPort (Size port)
Size getPort () const

Protected Attributes

Size port_
bool restart_
TCPIOStream connected_stream_
BALL_ASIO_NAMESPACE::io_service io_service_
BALL_ASIO_NAMESPACE::ip::tcp::acceptor acceptor_

Detailed Description

This class provides a base for very simple TCP-based servers.

By default, the server handles only one connection. The first request is accepted and converted into a TCPIOStream. If restart_ is set to true (default), the server listens again after the connection has been terminated.

Note that the server is not automatically started but rather waits for a call to "run".


Constructor & Destructor Documentation

BALL::TCPServer::TCPServer ( Size  port,
bool  restart = true 
) [inline]
virtual BALL::TCPServer::~TCPServer (  )  [virtual]

Member Function Documentation

virtual void BALL::TCPServer::activate (  )  [virtual]
virtual void BALL::TCPServer::connectionRequested (  )  [virtual]
virtual void BALL::TCPServer::deactivate (  )  [virtual]

Reimplemented in BALL::TCPServerThread.

Size BALL::TCPServer::getPort (  )  const
virtual void BALL::TCPServer::handleConnection (  )  [virtual]
void BALL::TCPServer::setPort ( Size  port  ) 
virtual void BALL::TCPServer::startAccepting (  )  [virtual]

Member Data Documentation

BALL_ASIO_NAMESPACE::ip::tcp::acceptor BALL::TCPServer::acceptor_ [protected]
BALL_ASIO_NAMESPACE::io_service BALL::TCPServer::io_service_ [protected]