Abstract base class for network sockets.
Definition abstractsocket.h:38
int _fd
Socket file descriptor.
Definition abstractsocket.h:203
Lightweight error code wrapper for the promeki library.
Definition error.h:39
OpenMode
Mode flags controlling how a device is opened.
Definition iodevice.h:33
Dynamic array container wrapping std::vector.
Definition list.h:40
Base object for promeki.
Definition objectbase.h:129
ObjectBase * parent() const
Returns the parent object, if one. nullptr if none.
Definition objectbase.h:258
Stream-oriented TCP socket.
Definition tcpsocket.h:35
Error open(OpenMode mode) override
Opens the socket.
int64_t read(void *data, int64_t maxSize) override
Reads data from the connected socket.
Error setNoDelay(bool enable)
Enables or disables TCP_NODELAY (Nagle algorithm).
Error setKeepAlive(bool enable)
Enables or disables SO_KEEPALIVE.
int64_t write(const void *data, int64_t maxSize) override
Writes data to the connected socket.
TcpSocket(ObjectBase *parent=nullptr)
Constructs a TcpSocket.
int64_t bytesAvailable() const override
Returns the number of bytes available for reading.
~TcpSocket() override
Destructor.
Error openIpv6(OpenMode mode)
Opens the socket for IPv6 operation.
bool isOpen() const override
Returns true if the socket is open.
Definition tcpsocket.h:76
Error close() override
Closes the socket.
#define PROMEKI_NAMESPACE_BEGIN
Starts a promeki namespace block.
Definition namespace.h:14
#define PROMEKI_NAMESPACE_END
Ends a promeki namespace block.
Definition namespace.h:19