Classes | Public Member Functions | List of all members
ndn::UnixTransport Class Reference
Inheritance diagram for ndn::UnixTransport:
ndn::Transport

Classes

class  ConnectionInfo
 A UnixTransport::ConnectionInfo extends Transport::ConnectionInfo to hold the file path of the Unix socket. More...
 

Public Member Functions

virtual bool isLocal (const Transport::ConnectionInfo &connectionInfo)
 Determine whether this transport connecting according to connectionInfo is to a node on the current machine. More...
 
virtual void connect (const Transport::ConnectionInfo &connectionInfo, ElementListener &elementListener)
 Connect according to the info in ConnectionInfo, and processEvents() will use elementListener. More...
 
virtual void send (const uint8_t *data, size_t dataLength)
 Set data to the host. More...
 
virtual void processEvents ()
 Process any data to receive. More...
 
virtual bool getIsConnected ()
 
virtual void close ()
 Close the connection to the host.
 
- Public Member Functions inherited from ndn::Transport
void send (const std::vector< uint8_t > &data)
 

Member Function Documentation

void ndn::UnixTransport::connect ( const Transport::ConnectionInfo connectionInfo,
ElementListener elementListener 
)
virtual

Connect according to the info in ConnectionInfo, and processEvents() will use elementListener.

Parameters
connectionInfoA reference to a UnixTransport::ConnectionInfo.
elementListenerNot a shared_ptr because we assume that it will remain valid during the life of this object.

Reimplemented from ndn::Transport.

bool ndn::UnixTransport::isLocal ( const Transport::ConnectionInfo connectionInfo)
virtual

Determine whether this transport connecting according to connectionInfo is to a node on the current machine.

Unix transports are always local.

Parameters
connectionInfoThis is ignored.
Returns
True because Unix transports are always local.

Reimplemented from ndn::Transport.

void ndn::UnixTransport::processEvents ( )
virtual

Process any data to receive.

For each element received, call elementListener.onReceivedElement. This is non-blocking and will return immediately if there is no data to receive. You should normally not call this directly since it is called by Face.processEvents.

Exceptions
Thismay throw an exception for reading data or in the callback for processing the data. If you call this from an main event loop, you may want to catch and log/disregard all exceptions.

Implements ndn::Transport.

void ndn::UnixTransport::send ( const uint8_t *  data,
size_t  dataLength 
)
virtual

Set data to the host.

Parameters
dataA pointer to the buffer of data to send.
dataLengthThe number of bytes in data.

Reimplemented from ndn::Transport.


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