Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends

GridClientTcpPacket Class Reference

#include <gridclienttcpconnection.hpp>

List of all members.

Public Member Functions

bool isPingPacket () const
size_t getHeaderSize () const
void setData (const ObjectWrapper &protoMsg)
ObjectWrapper getData () const
size_t getDataSize () const
void setAdditionalHeaders (const GridClientMessage &msg)
void setAdditionalHeaders (int8_t *pBuf)
void setAdditionalHeadersAndData (int8_t *pBuf, size_t size)

Static Public Member Functions

static void createPingPacket (GridClientTcpPacket &pingPacket)

Static Public Attributes

static const size_t BASIC_HEADER_SIZE = 5
static const size_t REGULAR_HEADER_SIZE = BASIC_HEADER_SIZE + ADDITIONAL_HEADERS_SIZE
static const int8_t SIGNAL_CHAR = (int8_t) 0x90

Friends

class GridClientSyncTcpConnection
class GridClientRawSyncTcpConnection
std::ostream & operator<< (std::ostream &stream, const GridClientTcpPacket &packet)

Detailed Description

This class represents a data packet used in GridGain binary protocol for data exchange.

The packet has the following structure:

----------------------------- | 0x90 (1 byte) | Special character to determine packet start. |---------------------------| | size (4 bytes) | Size of the data that follows. |---------------------------| | requestId (8 bytes) | | |---------------------------| | | clientId (16 bytes) | > These are called additional headers. |---------------------------| | | destinationId (16 bytes) | | |---------------------------| | DATA | -----------------------------


Member Function Documentation

void GridClientTcpPacket::createPingPacket ( GridClientTcpPacket &  pingPacket  )  [static]

Fills packet with ping data.

size_t GridClientTcpPacket::getHeaderSize (  )  const

Returns header size of this packet.

bool GridClientTcpPacket::isPingPacket (  )  const

Checks if this is a ping packet.

Returns:
true If this packet is a ping packet.

Checks if this is a ping packet.


Member Data Documentation

const size_t GridClientTcpPacket::BASIC_HEADER_SIZE = 5 [static]

Packet header size for ping packet.

const size_t GridClientTcpPacket::REGULAR_HEADER_SIZE = BASIC_HEADER_SIZE + ADDITIONAL_HEADERS_SIZE [static]

Maximum packet header size.

const int8_t GridClientTcpPacket::SIGNAL_CHAR = (int8_t) 0x90 [static]

First byte in binary protocol message.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends