Clarisse 5.0 SP8 SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
SysSocketServer Class Reference

This class represents a socket. More...

Inheritance diagram for SysSocketServer:
SysSocketBase CoreBaseObject CoreBaseType

Public Member Functions

 SysSocketServer (const unsigned int &port)
 Default Constructor.
SysSocketBaseaccept ()
 Accept and wait for a client to connect.
- Public Member Functions inherited from SysSocketBase
bool read (void *buffer, const size_t &nbytes)
 This function reads a buffer of nbytes bytes from the socket (wait mode)
bool write (void *buffer, const size_t &nbytes)
 This function writes a buffer of nbytes bytes to the socket (wait mode)
bool close ()
 Tries to close the socket.
const CoreStringget_address () const
const unsigned int & get_port () const
bool is_error () const
const Error & get_last_error () const
const ssize_t & last_count () const
bool is_connected () const
 Return true if the connection is active.
bool is_no_delay () const
bool set_no_delay (const bool &no_delay)
 Activate or desactivate the TCP_NODELAY flag.
virtual SysIPV4Address get_peer () const
 Get peer information.
SysSocketId * get_socket_id () const
- Public Member Functions inherited from CoreBaseObject
bool is_kindof (const CoreBaseObject &object) const
virtual size_t get_memory_size () const
CoreString get_class_info_name () const
const unsigned long & get_class_info_id () const
virtual bool is_kindof (const CoreClassInfo &cinfo) const
virtual const CoreClassInfoget_class_info () const
template<class T >
T * cast ()
template<class T >
const T * cast () const
- Public Member Functions inherited from CoreBaseType
bool is_kindof (const CoreClassInfo &cinfo) const

Additional Inherited Members

- Public Types inherited from SysSocketBase
enum  Error {
- Static Public Member Functions inherited from SysSocketBase
static const char * get_error_name (const Error &error)
static int get_hostname_from_ip (const CoreString &ip_address, CoreString &hostname)
static CoreString get_hostname ()
 Return local hostname.
- Protected Attributes inherited from SysSocketBase
CoreString m_address
unsigned int m_port
Error m_last_error
bool m_is_closed
ssize_t m_last_count
bool m_is_no_delay
SysSocketId * m_socket

Detailed Description

This class represents a socket.

This is a specialized server socket that will accept client connection. After each accepted connection will create a socket dedicated to client server transaction

Constructor & Destructor Documentation

SysSocketServer::SysSocketServer ( const unsigned int &  port)

Default Constructor.

[in]addressserver address
[in]portserver port

Member Function Documentation

SysSocketBase * SysSocketServer::accept ( )

Accept and wait for a client to connect.

If successfull return a new socket for client/server transaction. The returned socket must be deleted. If accept has failed it returns 0