UNISTDX_NET_SOCKET
using user_credentials = struct ::ucred

Alias to ucred system type.

using message_header = struct ::msghdr

Message header type for sending and receiving low-level socket messages.

using cmessage_header = struct ::cmsghdr

Message header type for sending and receiving ancillary data through socket.

enum socket_type

Socket types.

  • stream = SOCK_STREAM
  • datagram = SOCK_DGRAM
  • raw = SOCK_RAW
enum shutdown_flag: int

Socket shutdown options.

  • read = SHUT_RD
  • write = SHUT_WR
  • read_write = SHUT_RDWR
class sys::socket

Socket wrapper.

  • Socket is a file descriptor which is used for communication.
  • Usually, sockets are used for network communication.
  • The socket is non-blocking and automatically closed on child process execution.

Base classes
Derived classes
Types
  • using protocol_type = int

    Protocol number type.

  • using duration = clock_type::duration

    Duration type.

  • using clock_type = std::chrono::system_clock

    Clock type used in this class.

Enumerations
  • enum message_flags: int
  • enum option: int

    Socket options.

  • enum tcp_options: int
  • enum options: int
Methods
Friends
  • operator<<

    Print socket file descriptor and status.

struct sys::streambuf_traits< socket >

Stream buffer traits for socket.

Types
  • using char_type = void

    Character type.

Methods
  • read(socket & src, char_type * s, std::streamsize n) -> std::streamsize

    Read n bytes to array pointed by s from socket src.

  • write(socket & sink, const char_type * s, std::streamsize n) -> std::streamsize

    Write n bytes from array pointed by s to socket sink.

swap(socket & lhs, socket & rhs) -> void

Overload of std::swap for socket.

UNISTDX_FLAGS(socket::message_flags)
operator<<(std::ostream & out, const socket & rhs) -> std::ostream &

Print socket file descriptor and status.

UNISTDX_FLAGS(shutdown_flag)