BALL::TCPServer Class Reference

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

#include <networking.h>

Inheritance diagram for BALL::TCPServer:
Inheritance graph
[legend]

List of all members.


Public Member Functions

TCPServer (Size port, bool restart=true)
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".


Generated on Thu Aug 6 18:30:49 2009 for BALL by doxygen 1.5.8