Unix interface for using sockets.
More...
#include <socket_traits_unix.hpp>
|
typedef int | descriptor |
| Type of the system description of the socket.
|
|
Unix interface for using sockets.
- Author
- Julien Jorge
Definition at line 50 of file socket_traits_unix.hpp.
◆ descriptor
◆ accept()
Accept an incoming connexion.
- Parameters
-
d | The descriptor of the socket to listen. |
- Returns
- The descriptor of the incoming connexion.
Definition at line 194 of file socket_traits_unix.hpp.
◆ close()
static bool claw::socket_traits_unix::close |
( |
descriptor | d | ) |
|
|
inlinestatic |
Close a socket.
- Parameters
-
d | The descriptor of the socket to close. |
- Returns
- true if the socket has been closed.
Definition at line 97 of file socket_traits_unix.hpp.
◆ connect()
static bool claw::socket_traits_unix::connect |
( |
descriptor | d, |
|
|
const std::string & | address, |
|
|
int | port ) |
|
inlinestatic |
Connect a socket to a port.
- Parameters
-
d | The descriptor of the socket to connect. |
address | The adress to connect to. |
port | The port to connect to. |
- Returns
- true if the connection is available.
Definition at line 109 of file socket_traits_unix.hpp.
◆ init()
static bool claw::socket_traits_unix::init |
( |
| ) |
|
|
inlinestatic |
Initialize the use of the socket library.
- Returns
- true if the initialization is successful.
Definition at line 65 of file socket_traits_unix.hpp.
◆ is_open()
static bool claw::socket_traits_unix::is_open |
( |
descriptor | d | ) |
|
|
inlinestatic |
◆ listen()
static bool claw::socket_traits_unix::listen |
( |
descriptor | d, |
|
|
int | port, |
|
|
unsigned int | queue_size ) |
|
inlinestatic |
Open a socket for incoming connexions.
- Parameters
-
d | The descriptor of the socket to open. |
port | The port to connect to. |
queue_size | The size of the queue for incoming connexions. |
- Returns
- true if the socket has been opened.
Definition at line 139 of file socket_traits_unix.hpp.
◆ open()
static descriptor claw::socket_traits_unix::open |
( |
| ) |
|
|
inlinestatic |
◆ release()
static bool claw::socket_traits_unix::release |
( |
| ) |
|
|
inlinestatic |
Close the socket library.
- Returns
- true if the operation is successful.
Definition at line 74 of file socket_traits_unix.hpp.
◆ select_read()
static bool claw::socket_traits_unix::select_read |
( |
descriptor | d, |
|
|
int | time_limit = -1 ) |
|
inlinestatic |
Select a socket for reading.
- Parameters
-
d | The descriptor of the socket to read. |
time_limit | Maximum of seconds to wait before considering there's nothing to read. If time_limit is negative, the method wait until there is something to read. |
- Returns
- true if the socket is ready to be read.
Definition at line 164 of file socket_traits_unix.hpp.
◆ valid_descriptor()
static bool claw::socket_traits_unix::valid_descriptor |
( |
descriptor | d | ) |
|
|
inlinestatic |
◆ invalid_socket
const descriptor claw::socket_traits_unix::invalid_socket = -1 |
|
static |
The documentation for this class was generated from the following file: