utilmm::base_socket Class Reference
[OS-related tools]
#include <socket.hh>
List of all members.
Classes |
| struct | bad_address |
Public Types |
| enum | Domain { Unix,
Inet,
Unix,
Inet
} |
| enum | Domain { Unix,
Inet,
Unix,
Inet
} |
| enum | Type { Stream,
Datagram,
Stream,
Datagram
} |
| enum | Type { Stream,
Datagram,
Stream,
Datagram
} |
| enum | Wait {
WaitRead = 1,
WaitWrite = 2,
WaitException = 4,
WaitRead = 1,
WaitWrite = 2,
WaitException = 4
} |
| enum | Wait {
WaitRead = 1,
WaitWrite = 2,
WaitException = 4,
WaitRead = 1,
WaitWrite = 2,
WaitException = 4
} |
Public Member Functions |
| | base_socket (Domain domain, Type type) |
| | base_socket (int fd) |
| | base_socket (Domain domain, Type type) |
| | base_socket (int fd) |
| int | fd () const |
| int | fd () const |
| void | flush () const |
| void | flush () const |
| bool | try_wait (int what) const |
| bool | try_wait (int what) const |
| void | wait (int what) const |
| void | wait (int what) const |
| | ~base_socket () |
| | ~base_socket () |
Protected Member Functions |
| std::vector< uint8_t > | to_sockaddr (std::string const &to) const |
| std::vector< uint8_t > | to_sockaddr (std::string const &to) const |
Private Member Functions |
| int | wait (int what, timeval *tv) const |
| int | wait (int what, timeval *tv) const |
Static Private Member Functions |
| static int | to_unix (Type t) |
| static int | to_unix (Domain d) |
| static int | to_unix (Type t) |
| static int | to_unix (Domain d) |
Private Attributes |
| Domain | m_domain |
| int | m_fd |
| Type | m_type |
Detailed Description
Base class for sockets
Definition at line 16 of file install/include/utilmm/system/socket.hh.
Member Enumeration Documentation
- Enumerator:
| WaitRead |
|
| WaitWrite |
|
| WaitException |
|
| WaitRead |
|
| WaitWrite |
|
| WaitException |
|
Definition at line 21 of file utilmm/system/socket.hh.
Constructor & Destructor Documentation
| utilmm::base_socket::base_socket |
( |
int |
fd |
) |
|
| utilmm::base_socket::base_socket |
( |
Domain |
domain, |
|
|
Type |
type | |
|
) |
| | |
| utilmm::base_socket::~base_socket |
( |
|
) |
|
Closes the socket
Definition at line 56 of file socket.cc.
| utilmm::base_socket::base_socket |
( |
int |
fd |
) |
|
| utilmm::base_socket::base_socket |
( |
Domain |
domain, |
|
|
Type |
type | |
|
) |
| | |
| utilmm::base_socket::~base_socket |
( |
|
) |
|
Member Function Documentation
| int utilmm::base_socket::fd |
( |
|
) |
const |
Get the socket file descriptor
| int utilmm::base_socket::fd |
( |
|
) |
const |
Get the socket file descriptor
Definition at line 124 of file socket.cc.
| void utilmm::base_socket::flush |
( |
|
) |
const |
Flush all buffers related to this socket
| void utilmm::base_socket::flush |
( |
|
) |
const |
Flush all buffers related to this socket
Definition at line 160 of file socket.cc.
| std::vector<uint8_t> utilmm::base_socket::to_sockaddr |
( |
std::string const & |
to |
) |
const [protected] |
| vector< uint8_t > utilmm::base_socket::to_sockaddr |
( |
std::string const & |
to |
) |
const [protected] |
| static int utilmm::base_socket::to_unix |
( |
Type |
t |
) |
[static, private] |
| static int utilmm::base_socket::to_unix |
( |
Domain |
d |
) |
[static, private] |
| int utilmm::base_socket::to_unix |
( |
Type |
t |
) |
[static, private] |
| int utilmm::base_socket::to_unix |
( |
Domain |
d |
) |
[static, private] |
| bool utilmm::base_socket::try_wait |
( |
int |
what |
) |
const |
Non-blocking version of wait
- Parameters:
-
| what | an OR-ed field of values in the Wait enum |
- Returns:
- true if the event was present and false otherwise
| bool utilmm::base_socket::try_wait |
( |
int |
what |
) |
const |
Non-blocking version of wait
- Parameters:
-
| what | an OR-ed field of values in the Wait enum |
- Returns:
- true if the event was present and false otherwise
Definition at line 125 of file socket.cc.
| void utilmm::base_socket::wait |
( |
int |
what |
) |
const |
Blocks until one of the specified events is detected on this socket
- Parameters:
-
| what | an OR-ed field of values in the Wait enum |
| int utilmm::base_socket::wait |
( |
int |
what, |
|
|
timeval * |
tv | |
|
) |
| | const [private] |
| void utilmm::base_socket::wait |
( |
int |
what |
) |
const |
Blocks until one of the specified events is detected on this socket
- Parameters:
-
| what | an OR-ed field of values in the Wait enum |
Definition at line 130 of file socket.cc.
| int utilmm::base_socket::wait |
( |
int |
what, |
|
|
timeval * |
tv | |
|
) |
| | const [private] |
Member Data Documentation
The documentation for this class was generated from the following files: