6 #include "socketconnection.h"
27 const char *ip =
"unknown", uint16_t
port = 0);
44 size_t bytes_left = 0;
46 bool reading_header =
true;
std::string label() const
Return the object's log label.
Definition: logger.h:251
Simple protocol for exchanging messages.
Definition: shortmessageconnection.h:19
void sendMessage(const std::string &msg)
Send message to peer.
Definition: shortmessageconnection.cpp:65
ShortMessageConnection(const std::string &label, Task *owner, const std::string &hostname, uint16_t port)
For client sockets, connecting to a server.
Definition: shortmessageconnection.cpp:8
PollState connected() override
Will notify owner task that a new connection is available.
Definition: shortmessageconnection.cpp:20
PollState readData(char *buf, size_t len) override
Will notify owner when a complete message has been retrieved.
Definition: shortmessageconnection.cpp:24
This class implements low-level socket connection operations. Inherit from it to implement protocols ...
Definition: socketconnection.h:47
Task * owner() const
Return task owning the socket.
Definition: socket.h:27
std::string hostname() const
Return name of the host to which the socket is supposed to connect.
Definition: socket.h:32
uint16_t port() const
Return port number to which the socket is supposed to connect.
Definition: socket.h:37
The purpose of a task is to manage socket connections, and/or to execute timers.
Definition: task.h:39
PollState
Definition: pollstate.h:11