Classes | Macros | Functions
ISTcpClient.h File Reference
#include <string>
#include <inttypes.h>
#include "ISStream.h"
Include dependency graph for ISTcpClient.h:
This graph shows which files directly or indirectly include this file:

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)
 

Macro Definition Documentation

◆ IS_SOCKET_DEFAULT_TIMEOUT_MS

#define IS_SOCKET_DEFAULT_TIMEOUT_MS   5000

Definition at line 21 of file ISTcpClient.h.

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 Sat Sep 19 2020 03:19:06