virtual nsapi_error_t listen(int backlog=1)=0
Listen for incoming connections.
virtual nsapi_size_or_error_t sendto(const SocketAddress &address, const void *data, nsapi_size_t size)=0
Send a message on a socket.
virtual nsapi_error_t connect(const SocketAddress &address)=0
Connects socket to a remote address.
virtual nsapi_error_t setsockopt(int level, int optname, const void *optval, unsigned optlen)=0
Set socket options.
virtual nsapi_error_t bind(const SocketAddress &address)=0
Bind a specific address to a socket.
signed int nsapi_error_t
Type used to represent error codes.
virtual nsapi_size_or_error_t recvfrom(SocketAddress *address, void *data, nsapi_size_t size)=0
Receive a data from a socket.
virtual ~Socket()=default
Destroy a socket.
virtual nsapi_size_or_error_t recvfrom_control(SocketAddress *address, void *data, nsapi_size_t size, nsapi_msghdr_t *control, nsapi_size_t control_size)=0
Receive a data from a socket.
virtual void set_timeout(int timeout)=0
Set timeout on blocking socket operations.
signed int nsapi_size_or_error_t
Type used to represent either a size or error passed through sockets.
virtual nsapi_error_t getsockopt(int level, int optname, void *optval, unsigned *optlen)=0
Get socket options.
virtual nsapi_size_or_error_t recv(void *data, nsapi_size_t size)=0
Receive data from a socket.
virtual nsapi_size_or_error_t sendto_control(const SocketAddress &address, const void *data, nsapi_size_t size, nsapi_msghdr_t *control, nsapi_size_t control_size)=0
Send a message on a socket.
virtual void sigio(mbed::Callback< void()> func)=0
Register a callback on state change of the socket.
virtual nsapi_error_t getpeername(SocketAddress *address)=0
Get the remote-end peer associated with this socket.
virtual nsapi_size_or_error_t send(const void *data, nsapi_size_t size)=0
Send data on a socket.
virtual nsapi_error_t close()=0
Closes the socket.
unsigned int nsapi_size_t
Type used to represent the size of data passed through sockets.
virtual void set_blocking(bool blocking)=0
Set blocking or non-blocking mode of the socket.
Callback class based on template specialization.
virtual Socket * accept(nsapi_error_t *error=NULL)=0
Accepts a connection on a socket.