io
C++ I/O scheduling library with asynchronous socket operations
Loading...
Searching...
No Matches
Namespaces | Macros | Functions
socket.hpp File Reference

This file defines the core socket operations for the I/O library. More...

#include "socket_address.hpp"
#include "socket_handle.hpp"
#include "socket_message.hpp"
#include "socket_ops.hpp"

Go to the source code of this file.

Namespaces

namespace  io
 The io namespace contains all the functions and classes for the I/O library.
 
namespace  io::socket
 The io::socket namespace provides a cross-platform abstraction for socket-level I/O operations.
 

Functions

auto io::socket::tag_invoke (bind_t, const socket_handle &socket, const sockaddr_type *addr, socklen_type len) -> int
 Binds a socket to a local address.
 
auto io::socket::tag_invoke (bind_t, const socket_handle &socket, const socket_address &addr) -> int
 Binds a socket to a local address.
 
auto io::socket::tag_invoke (listen_t, const socket_handle &socket, int backlog) -> int
 Sets a socket to listen for incoming connections.
 
auto io::socket::tag_invoke (connect_t, const socket_handle &socket, const sockaddr_type *addr, socklen_type len) -> int
 Connects a socket to a remote address.
 
auto io::socket::tag_invoke (connect_t, const socket_handle &socket, const socket_address &addr) -> int
 Connects a socket to a remote address.
 
auto io::socket::tag_invoke (accept_t, const socket_handle &socket, sockaddr_type *addr, socklen_type *len) -> native_socket_type
 Accepts an incoming connection on a listening socket.
 
auto io::socket::tag_invoke (accept_t, const socket_handle &socket, socket_address addr={}) -> std::tuple< socket_handle, socket_address >
 Accepts an incoming connection on a listening socket.
 
auto io::socket::tag_invoke (sendmsg_t, const socket_handle &socket, const socket_message_type *msg, int flags) -> std::streamsize
 Sends a message on a socket.
 
auto io::socket::tag_invoke (sendmsg_t, const socket_handle &socket, const socket_message &msg) -> std::streamsize
 Sends a message on a socket using a socket_message object.
 
auto io::socket::tag_invoke (recvmsg_t, const socket_handle &socket, socket_message_type *msg, int flags) -> std::streamsize
 Receives a message from a socket.
 
auto io::socket::tag_invoke (getsockopt_t, const socket_handle &socket, int level, int optname, void *optval, socklen_type *optlen) -> int
 Gets a socket option.
 
auto io::socket::tag_invoke (setsockopt_t, const socket_handle &socket, int level, int optname, const void *optval, socklen_type optlen) -> int
 Sets a socket option.
 
auto io::socket::tag_invoke (getsockname_t, const socket_handle &socket, sockaddr_type *addr, socklen_type *len) -> int
 Gets the local address of a socket.
 
auto io::socket::tag_invoke (getpeername_t, const socket_handle &socket, sockaddr_type *addr, socklen_type *len) -> int
 Gets the peer address of a connected socket.
 
auto io::socket::tag_invoke (shutdown_t, const socket_handle &socket, int how) -> int
 Shuts down a socket connection.
 
template<typename... Args>
auto io::socket::tag_invoke (fcntl_t tag, const socket_handle &socket, int cmd, Args &&...args) -> int
 Performs a file control operation on a socket.
 

Detailed Description

This file defines the core socket operations for the I/O library.

It provides a cross-platform interface for socket programming by dispatching to platform-specific implementations. This file includes the necessary headers for socket operations and defines the io::socket namespace, which contains functions for creating, connecting, and managing sockets.

Definition in file socket.hpp.

Macro Definition Documentation

◆ IO_SOCKET_HPP

#define IO_SOCKET_HPP

Definition at line 27 of file socket.hpp.