Defined in file: hzProcess.h
The hzTcpClient manages a TCP client connection to a local or remote service. This may be to any legal port and opperate using any protocol.
Constructors/Detructors
| hzTcpClient* | hzTcpClient | (void) | |
| void | ~hzTcpClient | (void) |
Public Methods:
| void | Close | (void) | Closes the client TCP connection. If there is an SSL connection, this is shutdown and then the handle for the SSL is freed. Arguments: None Returns: None |
| hzEcode | ConnectIP | (hzIpaddr& ipa)uint32_t nPort, uint32_t nTimeoutR, uint32_t nTimeoutS, | Establish a standard, non-local, non-SSL TCP connection to a server at a known IP address. |
| hzEcode | ConnectLoc | (uint32_t nPort) | Purpose: Establish a UNIX domain TCP connection to a server |
| hzEcode | ConnectSSL | (const char* hostname)uint32_t nPort, uint32_t nTimeoutR, uint32_t nTimeoutS, | Purpose: Establish an SSL TCP connection to a server |
| hzEcode | ConnectStd | (const char* hostname)uint32_t nPort, uint32_t nTimeoutR, uint32_t nTimeoutS, | Establish a standard, non-local, non-SSL TCP connection to a server. Note that to re-connect in the event of a drop-out, just call this function again. A subsequent call will not repeat the DNS query unless it is to a different hostname. Note also that this function will do nothing if called with the same hostname, no error flag has been set and the socket is non-zero. The error flag is set by send or recv errors. |
| char* | GetBuffer | (void) | |
| hzEcode | Recv | (void* vpOut)uint32_t& nRecv, uint32_t nMax, | Purpose: Read from a socket into a buffer. |
| hzEcode | Recv | (hzChain& Z) | Purpose: Read from a socket into the supplied chain. The function terminates when no more bytes can be read from the socket. |
| hzEcode | Send | (const void* pIn)uint32_t nLen, | Purpose: Write buffer content to a socket |
| hzEcode | Send | (hzChain& C) | Purpose: Write chain content to a socket |
| void | SetDebug | (bool bDebug) | |
| hzEcode | SetRecvTimeout | (uint32_t nInterval) | Set the socket options so that the timeout for receiving packets is set to the supplied interval |
| hzEcode | SetSendTimeout | (uint32_t nInterval) | Set the socket options so that the timeout for outgoing packets is set to the supplied interval |
| void | Show | (hzChain& Z) | Diagnostic purposes. Show details for host if currently connected Returns: None |
| uint32_t | Sock | (void) |
Member Variables:
| char* | m_Buf | Internal buffer for I/O | |
| hzString | m_Hostname | Hostname (for diagnostics) | |
| hzIpaddr | m_Ipa | IP address of host | |
| sockaddr_in | m_SvrAddr | address of server | |
| bool | m_bDebug | Debug mode on (extra logs) | |
| bool | m_bError | Send/Recv failed. Must re-connect | |
| bool | m_bSSL | Connection will be SSL | |
| uint32_t | m_nBytesRecv | Bytes received | |
| uint32_t | m_nPort | Port | |
| uint32_t | m_nSock | Client socket given by server | |
| uint32_t | m_nTimeoutR | Recv timeout | |
| uint32_t | m_nTimeoutS | Send timeout | |
| hostent* | m_pHost | the server | |
| SSL* | m_pSSL | SSL entity for SSL connections |