Ginan
Loading...
Searching...
No Matches
TcpSocket Struct Reference
Inheritance diagram for TcpSocket:
Collaboration diagram for TcpSocket:

Public Member Functions

 TcpSocket (const string &url_str, const string &readUntil="\r\n\r\n")
 
void setUrl (const string &url_str)
 
void connect ()
 
void disconnect ()
 
void startRead (bool chunked)
 
void timeoutHandler (const boost::system::error_code &err)
 
void delayedReconnect ()
 
void connectHandler (const boost::system::error_code &err, tcp::resolver::iterator endpoint_iterator)
 
virtual void requestResponseHandler (const boost::system::error_code &err)
 
void logChunkError ()
 
void dataChunkDownloaded (vector< char > &dataChunk)
 
virtual void readContentDownloaded (vector< char > content)
 
virtual void connected ()
 
virtual void messageChunkLog (string message)
 
virtual void networkLog (string message)
 
void getData () override
 
void connectionError (const boost::system::error_code &err, string operation)
 
virtual ~TcpSocket ()=default
 
- Public Member Functions inherited from NetworkStatistics
string getNetworkStatistics (GTime now, string label)
 
void onConnectedStatistics ()
 
void onDisconnectedStatistics ()
 
void onChunkSentStatistics ()
 
void onChunkReceivedStatistics ()
 
void onErrorStatistics (const boost::system::error_code &err, string operation)
 
- Public Member Functions inherited from SerialStream
 SerialStream ()
 
 SerialStream (string path)
 
void openStream ()
 
unique_ptr< std::istream > getIStream_ptr () override
 
virtual ~SerialStream ()
 
- Public Member Functions inherited from Stream
virtual bool isDead ()
 Check to see if this stream has run out of data.
 
virtual ~Stream ()=default
 

Static Public Member Functions

static void runService ()
 
static void startClients ()
 

Data Fields

URL url
 
double reconnectDelay = 1
 
int disconnectionCount = 0
 
bool isConnected = false
 
int numberErroredChunks = 0
 
bool logHttpSentReceived = false
 
unsigned int content_length = 0
 
B_asio::ssl::context sslContext
 
- Data Fields inherited from NetworkStatistics
string streamName
 
GTime startTime
 
GTime endTime
 
string networkTraceFilename
 
int connectCount = 0
 
int disconnectCount = 0
 
int chunksSent = 0
 
int chunksReceived = 0
 
boost::posix_time::time_duration connectedDuration = boost::posix_time::hours(0)
 
boost::posix_time::time_duration disconnectedDuration = boost::posix_time::hours(0)
 
- Data Fields inherited from SerialStream
string path
 
int fileDescriptor = -1
 
vector< char > receivedData
 
- Data Fields inherited from Stream
string sourceString
 

Static Public Attributes

static B_asio::io_service ioService
 

Protected Attributes

std::shared_ptr< tcp::socket > _socket
 
tcp::socket * socket_ptr
 
std::shared_ptr< ssl_socket_sslsocket
 
std::shared_ptr< tcp::resolver > _resolver
 
boost::asio::deadline_timer timer
 
string readUntilString
 
string requestString
 
string responseString
 
boost::asio::streambuf request
 
boost::asio::streambuf downloadBuf
 
vector< char > receivedTcpData
 

Constructor & Destructor Documentation

◆ TcpSocket()

TcpSocket::TcpSocket ( const string & url_str,
const string & readUntil = "\r\n\r\n" )
inline

◆ ~TcpSocket()

virtual TcpSocket::~TcpSocket ( )
virtualdefault

Member Function Documentation

◆ connect()

void TcpSocket::connect ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ connected()

virtual void TcpSocket::connected ( )
inlinevirtual

Reimplemented in NtripUploader.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ connectHandler()

void TcpSocket::connectHandler ( const boost::system::error_code & err,
tcp::resolver::iterator endpoint_iterator )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ connectionError()

void TcpSocket::connectionError ( const boost::system::error_code & err,
string operation )
Here is the call graph for this function:

◆ dataChunkDownloaded()

void TcpSocket::dataChunkDownloaded ( vector< char > & dataChunk)
Here is the caller graph for this function:

◆ delayedReconnect()

void TcpSocket::delayedReconnect ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ disconnect()

void TcpSocket::disconnect ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getData()

void TcpSocket::getData ( )
overridevirtual

Reimplemented from SerialStream.

◆ logChunkError()

void TcpSocket::logChunkError ( )
Here is the call graph for this function:

◆ messageChunkLog()

virtual void TcpSocket::messageChunkLog ( string message)
inlinevirtual
Here is the caller graph for this function:

◆ networkLog()

virtual void TcpSocket::networkLog ( string message)
inlinevirtual
Here is the caller graph for this function:

◆ readContentDownloaded()

virtual void TcpSocket::readContentDownloaded ( vector< char > content)
inlinevirtual

◆ requestResponseHandler()

virtual void TcpSocket::requestResponseHandler ( const boost::system::error_code & err)
inlinevirtual

Reimplemented in NtripStream, and SisnetStream.

◆ runService()

static void TcpSocket::runService ( )
inlinestatic
Here is the caller graph for this function:

◆ setUrl()

void TcpSocket::setUrl ( const string & url_str)
inline

◆ startClients()

static void TcpSocket::startClients ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ startRead()

void TcpSocket::startRead ( bool chunked)
Here is the caller graph for this function:

◆ timeoutHandler()

void TcpSocket::timeoutHandler ( const boost::system::error_code & err)
Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ _resolver

std::shared_ptr<tcp::resolver> TcpSocket::_resolver
protected

◆ _socket

std::shared_ptr<tcp::socket> TcpSocket::_socket
protected

◆ _sslsocket

std::shared_ptr<ssl_socket> TcpSocket::_sslsocket
protected

◆ content_length

unsigned int TcpSocket::content_length = 0

◆ disconnectionCount

int TcpSocket::disconnectionCount = 0

◆ downloadBuf

boost::asio::streambuf TcpSocket::downloadBuf
protected

◆ ioService

B_asio::io_service TcpSocket::ioService
static

◆ isConnected

bool TcpSocket::isConnected = false

◆ logHttpSentReceived

bool TcpSocket::logHttpSentReceived = false

◆ numberErroredChunks

int TcpSocket::numberErroredChunks = 0

◆ readUntilString

string TcpSocket::readUntilString
protected

◆ receivedTcpData

vector<char> TcpSocket::receivedTcpData
protected

◆ reconnectDelay

double TcpSocket::reconnectDelay = 1

◆ request

boost::asio::streambuf TcpSocket::request
protected

◆ requestString

string TcpSocket::requestString
protected

◆ responseString

string TcpSocket::responseString
protected

◆ socket_ptr

tcp::socket* TcpSocket::socket_ptr
protected

◆ sslContext

B_asio::ssl::context TcpSocket::sslContext

◆ timer

boost::asio::deadline_timer TcpSocket::timer
protected

◆ url

URL TcpSocket::url

The documentation for this struct was generated from the following files: