Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
ServerSocket Class Referenceabstract

#include <elm/net/ServerSocket.h>

Public Member Functions

virtual ~ServerSocket (void)
 
virtual int port (void) const =0
 
virtual void open (void)=0
 
virtual Connectionlisten (void)=0
 
virtual void close (void)=0
 

Static Public Member Functions

static ServerSocketmake (void)
 
static ServerSocketmake (int port)
 

Detailed Description

This class provides a way to listen on a port for connection. For each connection, a dedicated object is created and returned.

Constructor & Destructor Documentation

◆ ~ServerSocket()

~ServerSocket ( void  )
virtual

Member Function Documentation

◆ close()

virtual void close ( void  )
pure virtual

◆ listen()

void listen ( void  )
pure virtual

void ServerSocket::close(void); Close the server socket.

Listen for a connection and return it.

Exceptions
ExceptionThrown if there is an error during the open.

Referenced by Server::manage().

◆ make() [1/2]

ServerSocket * make ( int  port)
static

Build a server working on the given port.

Parameters
portPort of the server.
Returns
Built server socket.

References ServerSocket::port().

◆ make() [2/2]

ServerSocket * make ( void  )
static

Build a server without specifying a precise port.

Returns
Built server socket.

Referenced by Server::open().

◆ open()

void open ( void  )
pure virtual

Open the port.

Exceptions
ExceptionThrown if there is an error during the open.

Referenced by Server::open().

◆ port()

int port ( void  ) const
pure virtual

Get the current port. This information is only meaningful once the server socket is opened.

Returns
Current socket server port.

Referenced by ServerSocket::make(), and Server::port().


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