1#ifndef TENDUKE_OSA_SOCKET_H
2#define TENDUKE_OSA_SOCKET_H
7namespace tenduke {
namespace osa {
29 virtual std::unique_ptr<Socket>
accept(uint32_t timeoutMs) = 0;
36 virtual std::unique_ptr<Socket>
accept() = 0;
51 virtual int read(
void * buffer, std::size_t bufferSize) = 0;
60 virtual int write(
const void * buffer, std::size_t len) = 0;
66 virtual std::uint16_t
getPort()
const = 0;
OS-independent abstraction of a socket.
Definition Socket.h:14
virtual int write(const void *buffer, std::size_t len)=0
Write bytes to the socket.
virtual int read(void *buffer, std::size_t bufferSize)=0
Reads bytes from the socket.
virtual void setNonBlocking()=0
Sets the socket to non-blocking mode.
virtual std::unique_ptr< Socket > accept()=0
Accepts next connection from listening socket.
virtual std::unique_ptr< Socket > accept(uint32_t timeoutMs)=0
Accepts next connection from listening socket, with a timeout.
virtual std::uint16_t getPort() const =0
Returns port of the socket.
virtual void listen()=0
Configures the socket to listen for incoming connections.
Root for classes, functions and globals of 10Duke C++ Client.
Definition APIRequest.h:4