Go to the source code of this file.
Classes | |
class | cISTcpClient |
Macros | |
#define | IS_SOCKET_DEFAULT_TIMEOUT_MS 5000 |
Functions | |
int | ISSocketCanRead (socket_t socket, int timeoutMilliseconds=IS_SOCKET_DEFAULT_TIMEOUT_MS) |
int | ISSocketCanWrite (socket_t socket, int timeoutMilliseconds=IS_SOCKET_DEFAULT_TIMEOUT_MS) |
int | ISSocketClose (socket_t &socket) |
void | ISSocketFrameworkInitialize () |
void | ISSocketFrameworkShutdown () |
int | ISSocketRead (socket_t socket, uint8_t *data, int dataLength) |
int | ISSocketSetBlocking (socket_t socket, bool blocking) |
int | ISSocketSetReadTimeout (socket_t socket, int timeoutMilliseconds) |
int | ISSocketWrite (socket_t socket, const uint8_t *data, int dataLength) |
#define IS_SOCKET_DEFAULT_TIMEOUT_MS 5000 |
Definition at line 21 of file ISTcpClient.h.
int ISSocketCanRead | ( | socket_t | socket, |
int | timeoutMilliseconds = IS_SOCKET_DEFAULT_TIMEOUT_MS |
||
) |
Determines if a socket can be read from
socket | the socket to check for read capability |
timeoutMilliseconds | the number of milliseconds to wait before aborting |
Definition at line 86 of file ISTcpClient.cpp.
int ISSocketCanWrite | ( | socket_t | socket, |
int | timeoutMilliseconds = IS_SOCKET_DEFAULT_TIMEOUT_MS |
||
) |
Determines if a socket can be written to
socket | the socket to check for write capability |
timeoutMilliseconds | the number of milliseconds to wait before aborting |
Definition at line 76 of file ISTcpClient.cpp.
int ISSocketClose | ( | socket_t & | socket | ) |
Close a socket and zero it out
socket | the socket to close, this will be zeroed out |
Definition at line 186 of file ISTcpClient.cpp.
void ISSocketFrameworkInitialize | ( | ) |
Initialize socket framework - called automatically by ISTcpClient and ISTcpServer
Definition at line 40 of file ISTcpClient.cpp.
void ISSocketFrameworkShutdown | ( | ) |
Shutdown socket framework - called automatically by ISTcpClient and ISTcpServer
Definition at line 57 of file ISTcpClient.cpp.
int ISSocketRead | ( | socket_t | socket, |
uint8_t * | data, | ||
int | dataLength | ||
) |
Read data from a socket
socket | the socket to read from |
data | the buffer to read data into |
dataLength | the number of bytes available in data |
Definition at line 118 of file ISTcpClient.cpp.
int ISSocketSetBlocking | ( | socket_t | socket, |
bool | blocking | ||
) |
Sets whether a socket is blocking. When reading, a blocking socket waits for the specified amount of data until the timeout is reached, a non-blocking socket returns immediately with the number of bytes read.
socket | the socket to set blocking for |
blocking | whether the socket is blocking |
Definition at line 145 of file ISTcpClient.cpp.
int ISSocketSetReadTimeout | ( | socket_t | socket, |
int | timeoutMilliseconds | ||
) |
Set a read timeout on a socket. This function is only useful for blocking sockets, where it is highly recommended.
socket | the socket to set the read timeout on |
timeoutMilliseconds | the timeout in milliseconds |
Definition at line 167 of file ISTcpClient.cpp.
int ISSocketWrite | ( | socket_t | socket, |
const uint8_t * | data, | ||
int | dataLength | ||
) |
Write data to a socket
socket | the socket to write to |
data | the data to write |
dataLength | the number of bytes in data |
Definition at line 96 of file ISTcpClient.cpp.