gloox  0.9.9.12
Public Member Functions | List of all members
SOCKS5BytestreamServer Class Reference

#include <socks5bytestreamserver.h>

Inheritance diagram for SOCKS5BytestreamServer:
Inheritance graph
[legend]
Collaboration diagram for SOCKS5BytestreamServer:
Collaboration graph
[legend]

Public Member Functions

 SOCKS5BytestreamServer (const LogSink &logInstance, int port, const std::string &ip="")
 ~SOCKS5BytestreamServer ()
ConnectionError listen ()
ConnectionError recv (int timeout)
void stop ()
virtual void handleIncomingConnection (ConnectionBase *connection)
virtual void handleReceivedData (const ConnectionBase *connection, const std::string &data)
virtual void handleConnect (const ConnectionBase *connection)
virtual void handleDisconnect (const ConnectionBase *connection, ConnectionError reason)
- Public Member Functions inherited from ConnectionHandler
virtual ~ConnectionHandler ()
- Public Member Functions inherited from ConnectionDataHandler
virtual ~ConnectionDataHandler ()

Detailed Description

A server listening for SOCKS5 bytestreams.

Note
You can use a single SOCKS5BytestreamServer instance with multiple Client objects.
It is safe to put a SOCKS5BytestreamServer instance into a separate thread.
Author
Jakob Schroeter js@ca.nosp@m.maya.nosp@m..net
Since
0.9

Definition at line 37 of file socks5bytestreamserver.h.

Constructor & Destructor Documentation

SOCKS5BytestreamServer ( const LogSink logInstance,
int  port,
const std::string &  ip = "" 
)

Constructs a new SOCKS5BytestreamServer.

Parameters
logInstanceA LogSink to use.
portThe local port to listen on.
ipThe local IP to bind to. If empty, the server will listen on all local interfaces.

Definition at line 21 of file socks5bytestreamserver.cpp.

Destructor.

Definition at line 28 of file socks5bytestreamserver.cpp.

Member Function Documentation

void handleConnect ( const ConnectionBase connection)
virtual

This function is called when e.g. the raw TCP connection was established.

Parameters
connectionThe connection.

Implements ConnectionDataHandler.

Definition at line 199 of file socks5bytestreamserver.cpp.

void handleDisconnect ( const ConnectionBase connection,
ConnectionError  reason 
)
virtual

This connection is called when e.g. the raw TCP connection was closed.

Parameters
connectionThe connection.
reasonThe reason for the disconnect.

Implements ConnectionDataHandler.

Definition at line 204 of file socks5bytestreamserver.cpp.

void handleIncomingConnection ( ConnectionBase connection)
virtual

This function is called to receive an incoming connection.

Parameters
connectionThe incoming connection.

Implements ConnectionHandler.

Definition at line 115 of file socks5bytestreamserver.cpp.

void handleReceivedData ( const ConnectionBase connection,
const std::string &  data 
)
virtual

This function is called for received from the underlying transport.

Parameters
connectionThe connection that received the data.
dataThe data received.

Implements ConnectionDataHandler.

Definition at line 123 of file socks5bytestreamserver.cpp.

ConnectionError listen ( )

Starts listening on the specified interface and port.

Returns
Returns ConnNoError on success, ConnIoError on failure (e.g. if the port is already in use).

Definition at line 38 of file socks5bytestreamserver.cpp.

ConnectionError recv ( int  timeout)

Call this function repeatedly to check for incoming connections and to negotiate them.

Parameters
timeoutThe timeout to use for select in microseconds.
Returns
The state of the listening socket.

Definition at line 46 of file socks5bytestreamserver.cpp.

void stop ( )

Stops listening and unbinds from the interface and port.

Definition at line 75 of file socks5bytestreamserver.cpp.


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