Fawkes API  Fawkes Development Version

FUSE Network Transceiver. More...

#include <>>

List of all members.

Static Public Member Functions

static void send (fawkes::StreamSocket *s, FuseNetworkMessageQueue *msgq)
 Send messages.
static void recv (fawkes::StreamSocket *s, FuseNetworkMessageQueue *msgq, unsigned int max_num_msgs=8)
 Receive data.

Detailed Description

FUSE Network Transceiver.

Utility class that provides methods to send and receive messages via the network. Operates on message queues and a given socket.

Author:
Tim Niemueller

Member Function Documentation

void firevision::FuseNetworkTransceiver::recv ( fawkes::StreamSocket s,
FuseNetworkMessageQueue msgq,
unsigned int  max_num_msgs = 8 
) [static]

Receive data.

This method receives all messages currently available from the network, or a limited number depending on max_num_msgs. If max_num_msgs is 0 then all messages are read. Note that on a busy connection this may cause recv() to never return! The default is to return after 8 messages. The messages are stored in the supplied message queue.

Parameters:
ssocket to gather messages from
msgqmessage queue to store received messages in
max_num_msgsmaximum number of messages to read from stream in one go.
Exceptions:
ConnectionDiedExceptionThrown if any error occurs during the operation since for any error the conncetion is considered dead.

Definition at line 92 of file fuse_transceiver.cpp.

References fawkes::LockQueue::lock(), fawkes::Socket::read(), firevision::FUSE_message_t::header, firevision::FUSE_header_t::payload_size, firevision::FUSE_message_t::payload, fawkes::Socket::available(), and fawkes::LockQueue::unlock().

void firevision::FuseNetworkTransceiver::send ( fawkes::StreamSocket s,
FuseNetworkMessageQueue msgq 
) [static]

Send messages.

Parameters:
ssocket over which the data shall be transmitted.
msgqmessage queue that contains the messages that have to be sent
Exceptions:
ConnectionDiedExceptionThrown if any error occurs during the operation since for any error the conncetion is considered dead.

Definition at line 57 of file fuse_transceiver.cpp.

References fawkes::LockQueue::lock(), firevision::FuseNetworkMessage::pack(), firevision::FuseNetworkMessage::fmsg(), firevision::FuseNetworkMessage::payload_size(), fawkes::Socket::write(), firevision::FUSE_message_t::header, firevision::FUSE_message_t::payload, fawkes::RefCount::unref(), and fawkes::LockQueue::unlock().


The documentation for this class was generated from the following files: