- Main Page
- Related Pages
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

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:
[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_addr | the multicast group to communicate with
  incoming_port | port for incoming messages
  outgoing_port | port 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:

  msg | pointer to data for sending
  bytes | sizeof 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:

  listener | pointer to instance to be notified of arriving messages

Implements SCS::NetworkConnector< can_t >.

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

- asioconnector.h