DelegateMQ
Loading...
Searching...
No Matches
NngTransport Class Reference

NNG transport class. NNG socket instances must only be called by a single thread of control. Each transport instance has its own internal thread of control and all transport APIs are asynchronous. Each instance is an "active object" with a private internal thread of control and async public APIs. More...

#include <NngTransport.h>

Inheritance diagram for NngTransport:
ITransport

Public Types

enum class  Type { PAIR_CLIENT , PAIR_SERVER , PUB , SUB }
 

Public Member Functions

 NngTransport ()
 
 ~NngTransport ()
 
int Create (Type type, const char *addr)
 
void Close ()
 
void Destroy ()
 
virtual int Send (xostringstream &os, const DmqHeader &header) override
 
virtual int Receive (xstringstream &is, DmqHeader &header) override
 
void SetTransportMonitor (ITransportMonitor *transportMonitor)
 
void SetSendTransport (ITransport *sendTransport)
 
void SetRecvTransport (ITransport *recvTransport)
 
- Public Member Functions inherited from ITransport

Detailed Description

NNG transport class. NNG socket instances must only be called by a single thread of control. Each transport instance has its own internal thread of control and all transport APIs are asynchronous. Each instance is an "active object" with a private internal thread of control and async public APIs.

Member Enumeration Documentation

◆ Type

enum class NngTransport::Type
strong
Enumerator
PAIR_CLIENT 
PAIR_SERVER 
PUB 
SUB 

Constructor & Destructor Documentation

◆ NngTransport()

NngTransport::NngTransport ( )
inline

◆ ~NngTransport()

NngTransport::~NngTransport ( )
inline

Member Function Documentation

◆ Close()

void NngTransport::Close ( )
inline

◆ Create()

int NngTransport::Create ( Type type,
const char * addr )
inline

◆ Destroy()

void NngTransport::Destroy ( )
inline

◆ Receive()

virtual int NngTransport::Receive ( xstringstream & is,
DmqHeader & header )
inlineoverridevirtual

Receive data from a remote

Parameters
[out]isThe received incoming data bytes, not including the header.
[out]headerIncoming delegate message header.
Returns
0 if success.

Implements ITransport.

◆ Send()

virtual int NngTransport::Send ( xostringstream & os,
const DmqHeader & header )
inlineoverridevirtual

Send data to a remote

Parameters
[in]osOutput stream to send.
[in]headerThe header to send.
Returns
0 if success.

Implements ITransport.

◆ SetRecvTransport()

void NngTransport::SetRecvTransport ( ITransport * recvTransport)
inline

◆ SetSendTransport()

void NngTransport::SetSendTransport ( ITransport * sendTransport)
inline

◆ SetTransportMonitor()

void NngTransport::SetTransportMonitor ( ITransportMonitor * transportMonitor)
inline

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