VoiceMan
Public Member Functions | List of all members
UnixSocket Class Reference

The UNIX domain socket. More...

Inheritance diagram for UnixSocket:
Socket

Public Member Functions

void open (const std::string &name)
 Creates new UNIX domain socket. More...
 
 UnixSocket ()
 The default constructor.
 
virtual ~UnixSocket ()
 The destructor.
 
- Public Member Functions inherited from Socket
void close ()
 Closes connection. More...
 
int getHandler () const
 Returns system connection handler. More...
 
bool opened () const
 Returns non-zero if connection was opened. More...
 
ssize_t read (void *buf, size_t s) const
 Reads data from the socket. More...
 
ssize_t read (std::string &s) const
 Reads data and saves it in string object. More...
 
 Socket ()
 The default constructor.
 
 Socket (int fd)
 The constructor with file descriptor specification. More...
 
ssize_t write (const void *buf, size_t s) const
 Writes data to socket. More...
 
virtual ~Socket ()
 The destructor. More...
 

Additional Inherited Members

- Protected Attributes inherited from Socket
bool m_opened
 
int m_sock
 

Detailed Description

This class is the interface to create server UNIX domain socket. No client behavior is implemented. Only file name of socket is required to prepare object of this class.

Member Function Documentation

void UnixSocket::open ( const std::string &  name)

This method creates new UNIX domain socket and prepares it for functioning. YOu should provide file name for new socket. This method does not return any exit code. All errors are reported with SystemException.

Parameters
[in]nameThe path to new UNIX domain socket
See also
SystemException