24 #include <netcomm/fawkes/transceiver.h> 25 #include <netcomm/fawkes/message.h> 26 #include <netcomm/fawkes/message_queue.h> 27 #include <netcomm/socket/stream.h> 28 #include <netcomm/utils/exceptions.h> 30 #include <netinet/in.h> 55 while ( ! msgq->empty() ) {
87 unsigned int max_num_msgs)
92 unsigned int num_msgs = 0;
93 while ( s->
available() && (num_msgs++ < max_num_msgs) ) {
99 if ( payload_size > 0 ) {
100 msg.
payload = malloc(payload_size);
A LockQueue of FawkesNetworkMessage to hold messages in inbound and outbound queues.
void unref()
Decrement reference count and conditionally delete this instance.
virtual void write(const void *buf, size_t count)
Write to the socket.
void unlock() const
Unlock list.
fawkes_message_header_t header
message header
Fawkes library namespace.
static void recv(StreamSocket *s, FawkesNetworkMessageQueue *msgq, unsigned int max_num_msgs=8)
Receive data.
Representation of a message that is sent over the network.
TCP stream socket over IP.
virtual bool available()
Check if data is available.
void pack()
Pack data for sending.
virtual size_t read(void *buf, size_t count, bool read_all=true)
Read from socket.
Message as stored in local queues.
void * payload
message payload
const fawkes_message_t & fmsg() const
Get message reference.
Thrown if the connection died during an operation.
void lock() const
Lock queue.
static void send(StreamSocket *s, FawkesNetworkMessageQueue *msgq)
Send messages.
size_t payload_size() const
Get payload size.