#include <gridclienttcpconnection.hpp>
Public Member Functions | |
| GridClientSyncTcpConnection () | |
| GridClientSyncTcpConnection (boost::shared_ptr< boost::asio::ssl::context > &ctx) | |
| virtual void | connect (const std::string &host, int port) |
| virtual void | authenticate (const std::string &clientId, const std::string &creds) |
| virtual std::string | sessionToken () |
| virtual void | send (const GridClientTcpPacket &gridTcpPacket, GridClientTcpPacket &result) |
| virtual void | sendPing () |
Protected Attributes | |
| boost::mutex | pingMux |
Synchronous implementation of TCP connection.
| GridClientSyncTcpConnection::GridClientSyncTcpConnection | ( | ) | [inline] |
Non-SSL TCP connection constructor.
| GridClientSyncTcpConnection::GridClientSyncTcpConnection | ( | boost::shared_ptr< boost::asio::ssl::context > & | ctx | ) | [inline] |
SSL TCP connection constructor.
| ctx | Shared pointer to a Boost SSL context. |
| virtual void GridClientSyncTcpConnection::authenticate | ( | const std::string & | clientId, | |
| const std::string & | creds | |||
| ) | [virtual] |
Authenticate client and store session token for later use.
| clientId | Client ID to authenticate. | |
| creds | Credentials to use. |
Implements GridClientTcpConnection.
| virtual void GridClientSyncTcpConnection::connect | ( | const std::string & | host, | |
| int | port | |||
| ) | [virtual] |
Connect to a host/port.
| pHost | Host name. | |
| pPort | Port to connect to. |
Implements GridClientTcpConnection.
| void GridClientSyncTcpConnection::send | ( | const GridClientTcpPacket & | gridTcpPacket, | |
| GridClientTcpPacket & | result | |||
| ) | [virtual] |
Sends a TCP packet over connection and receives a reply.
| gridTcpPacket | Binary data to send. | |
| result | Binary response. |
Implements GridClientTcpConnection.
Reimplemented in GridClientAsyncTcpConnection.
| void GridClientSyncTcpConnection::sendPing | ( | ) | [virtual] |
Sends a ping packet to the peer.
Implements GridClientConnection.
| std::string GridClientSyncTcpConnection::sessionToken | ( | ) | [virtual] |
Returns session token associated with this connection.
Implements GridClientTcpConnection.
boost::mutex GridClientSyncTcpConnection::pingMux [protected] |
Ping mutex, that protects from concurrent ping write intersection.
1.7.1