Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
UpstreamConnectionClient Class Reference

Connection client that connects to an upstream GridConnect-TCP hub via TCP client socket. More...

#include <ClientConnection.hxx>

Inheritance diagram for UpstreamConnectionClient:
GCFdConnectionClient ConnectionClient

Public Member Functions

template<typename HubType >
 UpstreamConnectionClient (const string &name, HubType *hub, const string &host, int port)
 Constructor.
 
- Public Member Functions inherited from GCFdConnectionClient
 GCFdConnectionClient (const string &name, CanHubFlow *hub)
 Constructor.
 
 GCFdConnectionClient (const string &name, ByteDirectHubInterface *direct_hub)
 Constructor.
 
bool ping () OVERRIDE
 Tests if the device is alive or encountered an error.
 
int fd () override
 

Private Member Functions

void try_connect () OVERRIDE
 Implementation of connection method.
 

Private Attributes

string host_
 where to connect to (host name)
 
int port_
 where to connect to (TCP port number)
 

Additional Inherited Members

- Protected Member Functions inherited from GCFdConnectionClient
void connection_complete (int fd)
 Callback from try_connect to donate the file descriptor.
 

Detailed Description

Connection client that connects to an upstream GridConnect-TCP hub via TCP client socket.

Definition at line 204 of file ClientConnection.hxx.

Constructor & Destructor Documentation

◆ UpstreamConnectionClient()

template<typename HubType >
UpstreamConnectionClient::UpstreamConnectionClient ( const string &  name,
HubType *  hub,
const string &  host,
int  port 
)
inline

Constructor.

Parameters
nameuser-readable name that will be printed upon an error.
hubCAN packet hub or GC DirectHub to connect this device to
hostwhere to connect to
portwhere to connect to

Definition at line 214 of file ClientConnection.hxx.

◆ ~UpstreamConnectionClient()

virtual UpstreamConnectionClient::~UpstreamConnectionClient ( )
inlinevirtual

Definition at line 222 of file ClientConnection.hxx.

Member Function Documentation

◆ try_connect()

void UpstreamConnectionClient::try_connect ( )
inlineprivatevirtual

Implementation of connection method.

Implements GCFdConnectionClient.

Definition at line 228 of file ClientConnection.hxx.

Member Data Documentation

◆ host_

string UpstreamConnectionClient::host_
private

where to connect to (host name)

Definition at line 245 of file ClientConnection.hxx.

◆ port_

int UpstreamConnectionClient::port_
private

where to connect to (TCP port number)

Definition at line 247 of file ClientConnection.hxx.


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