Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
socket_ops.h File Reference

Socket operations. More...

Include dependency graph for socket_ops.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  roc::netio::SocketOpts
 Socket options. More...
 

Namespaces

 roc
 Root namespace.
 
 roc::netio
 Network I/O.
 

Typedefs

typedef int roc::netio::SocketHandle
 Platform-specific socket handle. More...
 

Enumerations

enum  roc::netio::SocketType { roc::netio::SocketType_Tcp , roc::netio::SocketType_Udp }
 Socket type. More...
 
enum  roc::netio::SocketError { roc::netio::SockErr_WouldBlock = -1 , roc::netio::SockErr_StreamEnd = -2 , roc::netio::SockErr_Failure = -3 }
 I/O error codes. More...
 

Functions

ROC_ATTR_NODISCARD bool roc::netio::socket_create (address::AddrFamily family, SocketType type, SocketHandle &new_sock)
 Create non-blocking socket. More...
 
ROC_ATTR_NODISCARD bool roc::netio::socket_accept (SocketHandle sock, SocketHandle &new_sock, address::SocketAddr &remote_address)
 Accept incoming connection. More...
 
ROC_ATTR_NODISCARD bool roc::netio::socket_setup (SocketHandle sock, const SocketOpts &options)
 Set socket options. More...
 
ROC_ATTR_NODISCARD bool roc::netio::socket_bind (SocketHandle sock, address::SocketAddr &local_address)
 Bind socket to local address. More...
 
ROC_ATTR_NODISCARD bool roc::netio::socket_listen (SocketHandle sock, size_t backlog)
 Start listening for incoming connections. More...
 
ROC_ATTR_NODISCARD bool roc::netio::socket_begin_connect (SocketHandle sock, const address::SocketAddr &remote_address, bool &completed_immediately)
 Initiate connecting to remote peer. More...
 
ROC_ATTR_NODISCARD bool roc::netio::socket_end_connect (SocketHandle sock)
 Finish connecting to remote peer. More...
 
ROC_ATTR_NODISCARD ssize_t roc::netio::socket_try_recv (SocketHandle sock, void *buf, size_t bufsz)
 Try to read bytes from socket without blocking. More...
 
ROC_ATTR_NODISCARD ssize_t roc::netio::socket_try_send (SocketHandle sock, const void *buf, size_t bufsz)
 Try to write bytes to socket without blocking. More...
 
ROC_ATTR_NODISCARD ssize_t roc::netio::socket_try_send_to (SocketHandle sock, const void *buf, size_t bufsz, const address::SocketAddr &remote_address)
 Try to send datagram via socket to given address, without blocking. More...
 
ROC_ATTR_NODISCARD bool roc::netio::socket_shutdown (SocketHandle sock)
 Gracefully shutdown connection. More...
 
ROC_ATTR_NODISCARD bool roc::netio::socket_close (SocketHandle sock)
 Close socket. More...
 
ROC_ATTR_NODISCARD bool roc::netio::socket_close_with_reset (SocketHandle sock)
 Close socket and send reset to remote peer. Remote peer will get error when reading from connection. More...
 

Variables

const SocketHandle roc::netio::SocketInvalid = -1
 Invalid socket handle. More...
 

Detailed Description

Socket operations.

Definition in file socket_ops.h.