#include <tcp.hpp>
Public Types | |
typedef void(* | DisconnectFunction )(void *obj) |
typedef void(* | ReadFunction )(void *obj, UINT8 *inputBuffer, UINT32 &numBytes) |
Public Member Functions | |
void | close () |
UINT32 | getNumReadableBytes () |
bool | isOpen () |
bool | open (std::string ipAddress, UINT16 port, bool enableVerboseDebugOutput=false) |
bool | open (UINT32 ipAddress, UINT16 port, bool enableVerboseDebugOutput=false) |
UINT32 | read (UINT8 *buffer, UINT32 bufferLen) |
std::string | readString (UINT8 delimiter) |
void | setDisconnectCallbackFunction (DisconnectFunction discFunction, void *obj) |
void | setReadCallbackFunction (ReadFunction readFunction, void *obj) |
Tcp () | |
bool | write (UINT8 *buffer, UINT32 numberOfBytes) |
~Tcp () | |
Private Member Functions | |
bool | isClientConnected_unlocked () |
INT32 | readInputData () |
void | readThreadFunction (bool &endThread, UINT16 &waitTimeMs) |
void | startServerThread () |
void | stopReadThread () |
void | stopServerThread () |
Private Attributes | |
bool | m_beVerbose |
INT32 | m_connectionSocket |
DisconnectFunction | m_disconnectFunction |
void * | m_disconnectFunctionObjPtr |
bool | m_longStringWarningPrinted |
ReadFunction | m_readFunction |
void * | m_readFunctionObjPtr |
SickThread< Tcp,&Tcp::readThreadFunction > | m_readThread |
std::list< unsigned char > | m_rxBuffer |
std::string | m_rxString |
struct sockaddr_in | m_serverAddr |
Mutex | m_socketMutex |
typedef void(* Tcp::DisconnectFunction)(void *obj) |
typedef void(* Tcp::ReadFunction)(void *obj, UINT8 *inputBuffer, UINT32 &numBytes) |
void Tcp::close | ( | ) |
bool Tcp::isClientConnected_unlocked | ( | ) | [private] |
bool Tcp::isOpen | ( | ) |
INT32 Tcp::readInputData | ( | ) | [private] |
std::string Tcp::readString | ( | UINT8 | delimiter | ) |
void Tcp::readThreadFunction | ( | bool & | endThread, |
UINT16 & | waitTimeMs | ||
) | [private] |
void Tcp::setDisconnectCallbackFunction | ( | DisconnectFunction | discFunction, |
void * | obj | ||
) |
void Tcp::setReadCallbackFunction | ( | Tcp::ReadFunction | readFunction, |
void * | obj | ||
) |
void Tcp::startServerThread | ( | ) | [private] |
void Tcp::stopReadThread | ( | ) | [private] |
void Tcp::stopServerThread | ( | ) | [private] |
bool Tcp::write | ( | UINT8 * | buffer, |
UINT32 | numberOfBytes | ||
) |
bool Tcp::m_beVerbose [private] |
INT32 Tcp::m_connectionSocket [private] |
DisconnectFunction Tcp::m_disconnectFunction [private] |
void* Tcp::m_disconnectFunctionObjPtr [private] |
bool Tcp::m_longStringWarningPrinted [private] |
ReadFunction Tcp::m_readFunction [private] |
void* Tcp::m_readFunctionObjPtr [private] |
SickThread<Tcp, &Tcp::readThreadFunction> Tcp::m_readThread [private] |
std::list<unsigned char> Tcp::m_rxBuffer [private] |
std::string Tcp::m_rxString [private] |
struct sockaddr_in Tcp::m_serverAddr [private] |
Mutex Tcp::m_socketMutex [private] |