ConnectionTCPServer Class Reference

This is an implementation of a simple listening TCP connection. More...

#include <connectiontcpserver.h>

Inheritance diagram for ConnectionTCPServer:

Inheritance graph
[legend]
Collaboration diagram for ConnectionTCPServer:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ConnectionTCPServer (ConnectionHandler *ch, const LogSink &logInstance, const std::string &ip, int port)
virtual ~ConnectionTCPServer ()
virtual ConnectionError recv (int timeout=-1)
virtual ConnectionError connect ()
virtual ConnectionBasenewInstance () const


Detailed Description

This is an implementation of a simple listening TCP connection.

You should not need to use this class directly.

Author:
Jakob Schroeter <js@camaya.net>
Since:
0.9

Definition at line 36 of file connectiontcpserver.h.


Constructor & Destructor Documentation

ConnectionTCPServer ( ConnectionHandler ch,
const LogSink logInstance,
const std::string &  ip,
int  port 
)

Constructs a new ConnectionTCPServer object.

Parameters:
ch An ConnectionHandler-derived object that will handle incoming connections.
logInstance The log target. Obtain it from ClientBase::logInstance().
ip The local IP address to listen on. This must not be a hostname. Leave this empty to listen on all local interfaces.
port The port to listen on.

Definition at line 58 of file connectiontcpserver.cpp.

~ConnectionTCPServer (  )  [virtual]

Virtual destructor

Definition at line 65 of file connectiontcpserver.cpp.


Member Function Documentation

ConnectionError recv ( int  timeout = -1  )  [virtual]

Use this periodically to receive data from the socket and to feed the parser.

Parameters:
timeout The timeout to use for select in microseconds. Default of -1 means blocking.
Returns:
The state of the connection.

Implements ConnectionBase.

Definition at line 105 of file connectiontcpserver.cpp.

ConnectionError connect (  )  [virtual]

This function actually starts listening on the port given in the constructor.

Implements ConnectionBase.

Definition at line 74 of file connectiontcpserver.cpp.

ConnectionBase * newInstance (  )  const [virtual]

This function returns a new instance of the current ConnectionBase-derived object. The idea is to be able to 'clone' ConnectionBase-derived objects without knowing of what type they are exactly.

Returns:
A new Connection* instance.

Implements ConnectionBase.

Definition at line 69 of file connectiontcpserver.cpp.


The documentation for this class was generated from the following files:

Generated on Fri Oct 10 15:26:15 2008 for gloox by  doxygen 1.5.6