Base class for FD-based GridConnect connection clients.
More...
#include <ClientConnection.hxx>
|
| virtual void | try_connect ()=0 |
| | Abstrct base function to attempt to connect (or open device) to the destination.
|
| |
| void | connection_complete (int fd) |
| | Callback from try_connect to donate the file descriptor.
|
| |
Base class for FD-based GridConnect connection clients.
Definition at line 94 of file ClientConnection.hxx.
◆ GCFdConnectionClient() [1/2]
| GCFdConnectionClient::GCFdConnectionClient |
( |
const string & |
name, |
|
|
CanHubFlow * |
hub |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
| name | user-readable name for this port. |
| hub | CAN packet hub to connect this port to |
Definition at line 101 of file ClientConnection.hxx.
◆ GCFdConnectionClient() [2/2]
Constructor.
- Parameters
-
| name | user-readable name for this port. |
| direct_hub | gridconnect DirectHub to connect this device to. |
Definition at line 111 of file ClientConnection.hxx.
◆ ~GCFdConnectionClient()
| virtual GCFdConnectionClient::~GCFdConnectionClient |
( |
| ) |
|
|
inlinevirtual |
◆ connection_complete()
| void GCFdConnectionClient::connection_complete |
( |
int |
fd | ) |
|
|
protected |
Callback from try_connect to donate the file descriptor.
- Parameters
-
| fd | is the file destriptor of the connection freshly opened.
|
| fd | is the file destriptor of the connection freshly opened. |
Definition at line 43 of file ClientConnection.cxx.
◆ fd()
| int GCFdConnectionClient::fd |
( |
| ) |
|
|
inlineoverridevirtual |
- Returns
- the file descriptor, if this connection has one, or -1 if the connection is down or doesn't have an fd.
Reimplemented from ConnectionClient.
Definition at line 132 of file ClientConnection.hxx.
◆ ping()
| bool GCFdConnectionClient::ping |
( |
| ) |
|
|
inlinevirtual |
Tests if the device is alive or encountered an error.
Retries connection if an error happens.
- Returns
- true if the connection is live.
Implements ConnectionClient.
Definition at line 123 of file ClientConnection.hxx.
◆ try_connect()
| virtual void GCFdConnectionClient::try_connect |
( |
| ) |
|
|
protectedpure virtual |
◆ closedNotify_
Will be called when the descriptor experiences an error (typivcally upon device closed or connection lost).
Definition at line 149 of file ClientConnection.hxx.
◆ directHub_
◆ fd_
| int GCFdConnectionClient::fd_ {-1} |
|
private |
◆ hub_
The documentation for this class was generated from the following files: