ConnectionTCPServer Class Reference

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

#include <connectiontcpserver.h>

Inherits gloox::ConnectionTCPBase.

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 22 of file connectiontcpserver.cpp.

~ConnectionTCPServer (  )  [virtual]

Virtual destructor

Definition at line 29 of file connectiontcpserver.cpp.


Member Function Documentation

ConnectionError connect (  )  [virtual]

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

Implements ConnectionBase.

Definition at line 38 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 33 of file connectiontcpserver.cpp.

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

Use this periodically to receive data from the socket.

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 91 of file connectiontcpserver.cpp.


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

Generated by  doxygen 1.6.2