#include <ISTcpClient.h>
Definition at line 25 of file ISTcpClient.h.
◆ cISTcpClient() [1/2]
cISTcpClient::cISTcpClient |
( |
| ) |
|
◆ ~cISTcpClient()
cISTcpClient::~cISTcpClient |
( |
| ) |
|
|
virtual |
◆ cISTcpClient() [2/2]
◆ Close()
int cISTcpClient::Close |
( |
| ) |
|
|
virtual |
Close the client
- Returns
- 0 if success, otherwise an error code
Reimplemented from cISStream.
Definition at line 285 of file ISTcpClient.cpp.
◆ GetBlocking()
bool cISTcpClient::GetBlocking |
( |
| ) |
|
|
inline |
Get whether the client socket is blocking - blocking reads do not return until the data is read or a timeout occurs. Default is false.
- Returns
- whether the client is a blocking socket
Definition at line 88 of file ISTcpClient.h.
◆ HttpGet()
void cISTcpClient::HttpGet |
( |
const string & |
subUrl, |
|
|
const string & |
userAgent, |
|
|
const string & |
userName, |
|
|
const string & |
password |
|
) |
| |
Send a GET http request to a url. You must then call Read to get the response. SSL is NOT supported.
- Parameters
-
subUrl | the url to request, i.e. index.html or pages/page1.txt, etc. |
userAgent | the user agent to send |
userName | optional user name (basic authentication) |
password | optional password (basic authentication) |
Definition at line 310 of file ISTcpClient.cpp.
◆ IsOpen()
bool cISTcpClient::IsOpen |
( |
| ) |
|
|
inline |
Get whether the connection is open
- Returns
- true if connection open, false if not
Definition at line 82 of file ISTcpClient.h.
◆ Open()
Closes, then opens a tcp client
- Parameters
-
host | the host or ip address to connect to |
port | the port to connect to on the host |
timeoutMilliseconds | the max milliseconds to wait for a successful connection before aborting |
- Returns
- 0 if success, otherwise an error code
Definition at line 231 of file ISTcpClient.cpp.
◆ Read()
int cISTcpClient::Read |
( |
void * |
data, |
|
|
int |
dataLength |
|
) |
| |
|
virtual |
Read data from the client
- Parameters
-
data | the buffer to read data into |
dataLength | the number of bytes available in data |
- Returns
- the number of bytes read or less than 0 if error
Reimplemented from cISStream.
Definition at line 290 of file ISTcpClient.cpp.
◆ SetBlocking()
int cISTcpClient::SetBlocking |
( |
bool |
blocking | ) |
|
Sets whether the client socket is blocking. Default is false.
- Returns
- 0 if success otherwise an error code
Definition at line 323 of file ISTcpClient.cpp.
◆ Write()
int cISTcpClient::Write |
( |
const void * |
data, |
|
|
int |
dataLength |
|
) |
| |
|
virtual |
Write data to the client
- Parameters
-
data | the data to write |
dataLength | the number of bytes to write |
- Returns
- the number of bytes written or less than 0 if error
Reimplemented from cISStream.
Definition at line 300 of file ISTcpClient.cpp.
◆ m_blocking
bool cISTcpClient::m_blocking |
|
private |
◆ m_host
string cISTcpClient::m_host |
|
private |
◆ m_port
◆ m_socket
socket_t cISTcpClient::m_socket |
|
private |
The documentation for this class was generated from the following files: