scclib
Stable Cloud Computing C++ Library
|
Unix domain tcp (stream) socket. More...
#include <unix.h>
Public Member Functions | |
virtual void | reset () |
Reset the socket. | |
UnixAddr | get_addr () |
Get the socket address. | |
UnixTcpSock | accept () |
Accept a connection from an anonymous peer. More... | |
UnixTcpSock | accept (UnixAddr &) |
Accept a connection. More... | |
![]() | |
void | listen (int maxConnections=10) |
Set to accept connections. More... | |
void | connect (SockaddrBase &) |
Connect to a socket address. More... | |
void | connect (SockaddrBase &, std::error_code &) noexcept |
Connect to a socket address. More... | |
virtual size_t | read (void *loc, size_t len) |
Read bytes. More... | |
virtual size_t | write (const void *loc, size_t len) |
Write bytes. More... | |
void | shutdown () |
Shutdown the connection; no further reads or writes will be allowed. More... | |
![]() | |
SocketBase (SocketBase &&other) | |
Move construct socket. | |
const SocketBase & | operator= (SocketBase &&other) |
Move assign socket. | |
int | fd () const |
Return the underlying socket handle. | |
operator int () const | |
Allow object to be cast to a socket handle. | |
void | reuse_addr (bool r=true) |
Set address reusable. More... | |
void | reuse_port (bool r=true) |
Set port reusable. More... | |
void | non_blocking (bool b=true) |
Set the socket non-blocking. More... | |
std::error_code | error_code () |
Get the current error code (status). More... | |
void | recv_bufsize (unsigned) |
Set receive buffer size. More... | |
unsigned | recv_bufsize () |
Get total receive buffer size including overhead. | |
void | send_bufsize (unsigned) |
Set send buffer size. More... | |
unsigned | send_bufsize () |
Get total send buffer size including overhead. | |
void | send_timeout (std::chrono::milliseconds) |
Set the send timeout. More... | |
void | recv_timeout (std::chrono::milliseconds) |
Set the receive timeout. More... | |
void | bind (const SockaddrBase &) |
Bind an address to the socket. | |
size_t | recv (void *loc, size_t len) |
Receive bytes, throwing an exception on error. More... | |
size_t | recv (void *loc, size_t len, std::error_code &e) noexcept |
Receive bytes. More... | |
size_t | send (const void *loc, size_t len) |
Send bytes, throwing an exception on error. More... | |
size_t | send (const void *loc, size_t len, std::error_code &e) noexcept |
Send bytes, setting the error code for the call. More... | |
void | close () |
Close the socket. | |
Additional Inherited Members | |
![]() | |
TcpSocket (int fd) | |
TcpSocket (int domain, int stype, int proto) | |
int | accept (sockaddr *, int len, std::error_code &) noexcept |
Accept a connection. More... | |
![]() | |
SocketBase (int fd) | |
SocketBase (int, int, int) | |
void | reset (int, int, int) |
void | move (SocketBase &other) |
void | get_sockaddr (sockaddr &) |
Unix domain tcp (stream) socket.
UnixTcpSock UnixTcpSock::accept | ( | ) |
UnixTcpSock UnixTcpSock::accept | ( | UnixAddr & | peer | ) |