Functions
ISTcpClient.cpp File Reference
#include "ISConstants.h"
#include "ISTcpClient.h"
#include "ISUtilities.h"
Include dependency graph for ISTcpClient.cpp:

Go to the source code of this file.

Functions

int ISSocketCanRead (socket_t socket, int timeoutMilliseconds)
 
int ISSocketCanWrite (socket_t socket, int timeoutMilliseconds)
 
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)
 

Function Documentation

◆ ISSocketCanRead()

int ISSocketCanRead ( socket_t  socket,
int  timeoutMilliseconds = IS_SOCKET_DEFAULT_TIMEOUT_MS 
)

Determines if a socket can be read from

Parameters
socketthe socket to check for read capability
timeoutMillisecondsthe number of milliseconds to wait before aborting
Returns
non-zero if the socket can be read from, otherwise zero

Definition at line 86 of file ISTcpClient.cpp.

◆ ISSocketCanWrite()

int ISSocketCanWrite ( socket_t  socket,
int  timeoutMilliseconds = IS_SOCKET_DEFAULT_TIMEOUT_MS 
)

Determines if a socket can be written to

Parameters
socketthe socket to check for write capability
timeoutMillisecondsthe number of milliseconds to wait before aborting
Returns
non-zero if the socket can be written to, otherwise zero

Definition at line 76 of file ISTcpClient.cpp.

◆ ISSocketClose()

int ISSocketClose ( socket_t &  socket)

Close a socket and zero it out

Parameters
socketthe socket to close, this will be zeroed out
Returns
0 if success otherwise an error code

Definition at line 186 of file ISTcpClient.cpp.

◆ ISSocketFrameworkInitialize()

void ISSocketFrameworkInitialize ( )

Initialize socket framework - called automatically by ISTcpClient and ISTcpServer

Definition at line 40 of file ISTcpClient.cpp.

◆ ISSocketFrameworkShutdown()

void ISSocketFrameworkShutdown ( )

Shutdown socket framework - called automatically by ISTcpClient and ISTcpServer

Definition at line 57 of file ISTcpClient.cpp.

◆ ISSocketRead()

int ISSocketRead ( socket_t  socket,
uint8_t *  data,
int  dataLength 
)

Read data from a socket

Parameters
socketthe socket to read from
datathe buffer to read data into
dataLengththe number of bytes available in data
Returns
the number of bytes read or less than 0 if error, in which case the socket is probably disconnected

Definition at line 118 of file ISTcpClient.cpp.

◆ ISSocketSetBlocking()

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.

Parameters
socketthe socket to set blocking for
blockingwhether the socket is blocking
Returns
0 if success otherwise an error code

Definition at line 145 of file ISTcpClient.cpp.

◆ ISSocketSetReadTimeout()

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.

Parameters
socketthe socket to set the read timeout on
timeoutMillisecondsthe timeout in milliseconds
Returns
0 if success otherwise an error code

Definition at line 167 of file ISTcpClient.cpp.

◆ ISSocketWrite()

int ISSocketWrite ( socket_t  socket,
const uint8_t *  data,
int  dataLength 
)

Write data to a socket

Parameters
socketthe socket to write to
datathe data to write
dataLengththe number of bytes in data
Returns
the number of bytes written or less than 0 if error, in which case the socket is probably disconnected

Definition at line 96 of file ISTcpClient.cpp.



inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:59