|
Claw
1.7.3
|
Unix interface for using sockets. More...
#include <socket_traits_unix.hpp>
Public Types | |
| typedef int | descriptor |
| Type of the system description of the socket. | |
Static Public Member Functions | |
| static bool | init () |
| Initialize the use of the socket library. | |
| static bool | release () |
| Close the socket library. | |
| static descriptor | open () |
| Open a socket. | |
| static bool | close (descriptor d) |
| Close a socket. | |
| static bool | connect (descriptor d, const std::string &address, int port) |
| Connect a socket to a port. | |
| static bool | listen (descriptor d, int port, unsigned int queue_size) |
| Open a socket for incoming connexions. | |
| static bool | select_read (descriptor d, int time_limit=-1) |
| Select a socket for reading. | |
| static descriptor | accept (descriptor d) |
| Accept an incoming connexion. | |
| static bool | valid_descriptor (descriptor d) |
| Tell if a descriptor is a valid socket descriptor. | |
| static bool | is_open (descriptor d) |
| Tell if a descriptor is a opened socket. | |
Static Public Attributes | |
| static const descriptor | invalid_socket = -1 |
| Invalid socket descriptor. | |
Unix interface for using sockets.
Definition at line 50 of file socket_traits_unix.hpp.
|
inlinestatic |
Accept an incoming connexion.
| d | The descriptor of the socket to listen. |
Definition at line 202 of file socket_traits_unix.hpp.
Referenced by claw::net::socket_server::accept().
|
inlinestatic |
Close a socket.
| d | The descriptor of the socket to close. |
Definition at line 101 of file socket_traits_unix.hpp.
Referenced by claw::net::basic_socket::close().
|
inlinestatic |
Connect a socket to a port.
| d | The descriptor of the socket to connect. |
| address | The adress to connect to. |
| port | The port to connect to. |
Definition at line 114 of file socket_traits_unix.hpp.
References CLAW_PRECOND, and invalid_socket.
|
inlinestatic |
Initialize the use of the socket library.
Definition at line 66 of file socket_traits_unix.hpp.
Referenced by claw::net::socket_server::init().
|
inlinestatic |
Tell if a descriptor is a opened socket.
| d | The descriptor to test. |
Definition at line 222 of file socket_traits_unix.hpp.
Referenced by claw::net::basic_socketbuf< CharT, Traits >::open().
|
inlinestatic |
Open a socket for incoming connexions.
| d | The descriptor of the socket to open. |
| port | The port to connect to. |
| queue_size | The size of the queue for incoming connexions. |
Definition at line 145 of file socket_traits_unix.hpp.
References CLAW_PRECOND, and invalid_socket.
Referenced by claw::net::socket_server::open().
|
inlinestatic |
Open a socket.
Definition at line 86 of file socket_traits_unix.hpp.
References invalid_socket.
Referenced by claw::net::basic_socket::open().
|
inlinestatic |
Close the socket library.
Definition at line 76 of file socket_traits_unix.hpp.
Referenced by claw::net::socket_server::release().
|
inlinestatic |
Select a socket for reading.
| 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. |
Definition at line 171 of file socket_traits_unix.hpp.
References CLAW_PRECOND, and invalid_socket.
Referenced by claw::net::socket_server::accept(), and claw::net::basic_socketbuf< CharT, Traits >::underflow().
|
inlinestatic |
Tell if a descriptor is a valid socket descriptor.
| d | The descriptor to test. |
Definition at line 212 of file socket_traits_unix.hpp.
References invalid_socket.
Referenced by claw::net::basic_socket::is_open(), and claw::net::basic_socket::open().
1.8.1.2