Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::net::ClientSocket Class Referenceabstract

#include <elm/net/ClientSocket.h>

Public Member Functions

virtual ~ClientSocket (void)
 
virtual int port (void) const =0
 
virtual const stringhost (void) const =0
 
virtual const stringservice (void) const =0
 
virtual void connect (void)=0 throw (Exception)
 
virtual void disconnect (void)=0 throw (Exception)
 
virtual io::InStreamin (void)=0 throw (Exception)
 
virtual io::OutStreamout (void)=0 throw (Exception)
 

Static Public Member Functions

static ClientSocketmake (const string &host, int port)
 
static ClientSocketmake (const string &host, const string &service)
 
static ClientSocketmake (int port)
 

Detailed Description

Class implementing a client through a socket connection.

Constructor & Destructor Documentation

virtual elm::net::ClientSocket::~ClientSocket ( void  )
virtual

Member Function Documentation

void elm::net::ClientSocket::connect ( void  )
throw (Exception
)
pure virtual

Connect the client to the server.

Exceptions
ExceptionIf there is an error.
void elm::net::ClientSocket::disconnect ( void  )
throw (Exception
)
pure virtual

Disconnect from the server.

Exceptions
ExceptionIf there is an error.
const string & elm::net::ClientSocket::host ( void  ) const
pure virtual

Get the host name of the server the client has to connect to.

Returns
Server host name.
io::InStream & elm::net::ClientSocket::in ( void  )
throw (Exception
)
pure virtual

Obtain the input channel for the connection.

Returns
Input channel.
Exceptions
ExceptionIf there is an error.
ClientSocket * elm::net::ClientSocket::make ( const string host,
int  port 
)
static

Build a client socket connecting to the given host on the given port.

Parameters
hostHost to connect to (numeric or symbolic form).
portPort to connect to.
ClientSocket * elm::net::ClientSocket::make ( const string host,
const string service 
)
static

Build a client socket connecting to the given host with the given service.

Parameters
hostHost to connect to (numeric or symbolic form).
serviceService to connect to.
ClientSocket * elm::net::ClientSocket::make ( int  port)
static

Build a client socket connecting to the local host on the given port.

Parameters
portPort to connect to.
io::OutStream & elm::net::ClientSocket::out ( void  )
throw (Exception
)
pure virtual

Obtain the output channel for the connection.

Returns
Output channel.
Exceptions
ExceptionIf there is an error.
int elm::net::ClientSocket::port ( void  ) const
pure virtual

Get the port of the client.

Returns
Connection port.
const string & elm::net::ClientSocket::service ( void  ) const
pure virtual

If any, get the name of the service of connection.

Returns
Connected service name.

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