#include <gridclienttcpconnection.hpp>
Public Member Functions | |
| GridClientTcpConnection () | |
| GridClientTcpConnection (boost::shared_ptr< boost::asio::ssl::context > &ctx) | |
| virtual | ~GridClientTcpConnection () |
| virtual void | connect (const std::string &host, int port)=0 |
| virtual void | authenticate (const std::string &clientId, const std::string &creds)=0 |
| virtual std::string | sessionToken ()=0 |
| virtual void | send (const GridClientTcpPacket &gridTcpPacket, GridClientTcpPacket &result)=0 |
Protected Member Functions | |
| int | getPacketSize (const int8_t *header) |
TCP connection class used for sending data and storing session token associated with it in case of secure connection.
| GridClientTcpConnection::GridClientTcpConnection | ( | ) | [inline] |
Non-SSL TCP connection constructor.
| GridClientTcpConnection::GridClientTcpConnection | ( | boost::shared_ptr< boost::asio::ssl::context > & | ctx | ) | [inline] |
SSL TCP connection constructor.
| ctx | Shared pointer to a Boost SSL context. |
| virtual GridClientTcpConnection::~GridClientTcpConnection | ( | ) | [inline, virtual] |
Destructor.
| virtual void GridClientTcpConnection::authenticate | ( | const std::string & | clientId, | |
| const std::string & | creds | |||
| ) | [pure virtual] |
Authenticate client and store session token for later use.
| clientId | Client ID to authenticate. | |
| creds | Credentials to use. |
Implemented in GridClientSyncTcpConnection, and GridClientRawSyncTcpConnection.
| virtual void GridClientTcpConnection::connect | ( | const std::string & | host, | |
| int | port | |||
| ) | [pure virtual] |
Connect to a host/port.
| pHost | Host name. | |
| pPort | Port to connect to. |
Implemented in GridClientSyncTcpConnection, and GridClientRawSyncTcpConnection.
| int GridClientTcpConnection::getPacketSize | ( | const int8_t * | header | ) | [protected] |
Calculates packet size from packet data.
| header | Packet header. |
| virtual void GridClientTcpConnection::send | ( | const GridClientTcpPacket & | gridTcpPacket, | |
| GridClientTcpPacket & | result | |||
| ) | [pure virtual] |
Sends a TCP packet over connection and receives a reply.
| gridTcpPacket | Binary data to send. | |
| result | Binary response. |
Implemented in GridClientSyncTcpConnection, GridClientRawSyncTcpConnection, and GridClientAsyncTcpConnection.
| virtual std::string GridClientTcpConnection::sessionToken | ( | ) | [pure virtual] |
Returns session token associated with this connection.
Implemented in GridClientSyncTcpConnection, and GridClientRawSyncTcpConnection.
1.7.1