Public Member Functions

SCS::ASIOConnector Class Reference

Implementation of the NetworkConnector for CAN Aerospace messages using the UDPSender and UDPReceiver classes for asynchronous communication. More...

#include <asioconnector.h>

Inheritance diagram for SCS::ASIOConnector:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 ASIOConnector (const std::string &host_addr, int incoming_port, int outgoing_port)
 ~ASIOConnector ()
void setListener (BusConnector< can_t > *listener)
void send (const void *msg, std::size_t bytes)

Detailed Description

Implementation of the NetworkConnector for CAN Aerospace messages using the UDPSender and UDPReceiver classes for asynchronous communication.

Build on top of the boost::asio library using two threads for asynchronous sending and receiving of UDP messages.

Note:
This class is reentrant. There is no guarantee the receiver callback will be called from the main thread. Receiving callbacks must be thread-safe.
Author:
(c) 2009,2010 by Philipp Münzel
Version:
1.3

Constructor & Destructor Documentation

SCS::ASIOConnector::ASIOConnector ( const std::string &  host_addr,
int  incoming_port,
int  outgoing_port 
)
Parameters:
host_addrthe multicast group to communicate with
incoming_portport for incoming messages
outgoing_portport for outgoing messages
SCS::ASIOConnector::~ASIOConnector ( )

Cancel all I/O operations, close sockets and join threads


Member Function Documentation

void SCS::ASIOConnector::send ( const void *  msg,
std::size_t  bytes 
) [virtual]
Parameters:
msgpointer to data for sending
bytessizeof data to send

Implements SCS::NetworkConnector< can_t >.

void SCS::ASIOConnector::setListener ( BusConnector< can_t > *  listener) [virtual]
Note:
No ownership tranfer, the caller is responsible for cleaning up this instance
Parameters:
listenerpointer to instance to be notified of arriving messages

Implements SCS::NetworkConnector< can_t >.


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