Classes | Macros | Typedefs | Functions
SocketBuffer.h File Reference
#include <sys/socket.h>
Include dependency graph for SocketBuffer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pending_writes
 
struct  socket_queue
 

Macros

#define SOCKET_ERROR   -1
 
#define SOCKETBUFFER_COMPLETE   0
 
#define SOCKETBUFFER_INTERRUPTED   -22 /* must be the same value as TCPSOCKET_INTERRUPTED */
 

Typedefs

typedef struct iovec iobuf
 

Functions

void SocketBuffer_cleanup (int socket)
 
char * SocketBuffer_complete (int socket)
 
int SocketBuffer_getQueuedChar (int socket, char *c)
 
char * SocketBuffer_getQueuedData (int socket, size_t bytes, size_t *actual_len)
 
pending_writesSocketBuffer_getWrite (int socket)
 
int SocketBuffer_initialize (void)
 
void SocketBuffer_interrupted (int socket, size_t actual_len)
 
int SocketBuffer_pendingWrite (int socket, int count, iobuf *iovecs, int *frees, size_t total, size_t bytes)
 
void SocketBuffer_queueChar (int socket, char c)
 
void SocketBuffer_terminate (void)
 
pending_writesSocketBuffer_updateWrite (int socket, char *topic, char *payload)
 
int SocketBuffer_writeComplete (int socket)
 

Macro Definition Documentation

#define SOCKET_ERROR   -1

Definition at line 62 of file SocketBuffer.h.

#define SOCKETBUFFER_COMPLETE   0

Definition at line 60 of file SocketBuffer.h.

#define SOCKETBUFFER_INTERRUPTED   -22 /* must be the same value as TCPSOCKET_INTERRUPTED */

Definition at line 64 of file SocketBuffer.h.

Typedef Documentation

typedef struct iovec iobuf

Definition at line 34 of file SocketBuffer.h.

Function Documentation

void SocketBuffer_cleanup ( int  socket)

Cleanup any buffers for a specific socket

Parameters
socketthe socket to clean up

Definition at line 151 of file SocketBuffer.c.

char* SocketBuffer_complete ( int  socket)

A socket read has now completed so we can get rid of the queue

Parameters
socketthe socket for which the operation is now complete
Returns
pointer to the default queue data

Definition at line 281 of file SocketBuffer.c.

int SocketBuffer_getQueuedChar ( int  socket,
char *  c 
)

Get any queued character for a specific socket

Parameters
socketthe socket to get queued data for
cthe character returned if any
Returns
completion code

Definition at line 219 of file SocketBuffer.c.

char* SocketBuffer_getQueuedData ( int  socket,
size_t  bytes,
size_t *  actual_len 
)

Get any queued data for a specific socket

Parameters
socketthe socket to get queued data for
bytesthe number of bytes of data to retrieve
actual_lenthe actual length returned
Returns
the actual data

Definition at line 176 of file SocketBuffer.c.

pending_writes* SocketBuffer_getWrite ( int  socket)

Get any queued write data for a specific socket

Parameters
socketthe socket to get queued data for
Returns
pointer to the queued data or NULL

Definition at line 399 of file SocketBuffer.c.

int SocketBuffer_initialize ( void  )

Initialize the socketBuffer module

Definition at line 102 of file SocketBuffer.c.

void SocketBuffer_interrupted ( int  socket,
size_t  actual_len 
)

A socket read was interrupted so we need to queue data

Parameters
socketthe socket to get queued data for
actual_lenthe actual length of data that was read

Definition at line 252 of file SocketBuffer.c.

int SocketBuffer_pendingWrite ( int  socket,
int  count,
iobuf iovecs,
int *  frees,
size_t  total,
size_t  bytes 
)

A socket write was interrupted so store the remaining data

Parameters
socketthe socket for which the write was interrupted
countthe number of iovec buffers
iovecsbuffer array
freesa set of flags indicating which of the iovecs array should be freed
totaltotal data length to be written
bytesactual data length that was written

Definition at line 349 of file SocketBuffer.c.

void SocketBuffer_queueChar ( int  socket,
char  c 
)

Queued a Charactor to a specific socket

Parameters
socketthe socket for which to queue char for
cthe character to queue

Definition at line 303 of file SocketBuffer.c.

void SocketBuffer_terminate ( void  )

Terminate the socketBuffer module

Definition at line 133 of file SocketBuffer.c.

pending_writes* SocketBuffer_updateWrite ( int  socket,
char *  topic,
char *  payload 
)

Update the queued write data for a socket in the case of QoS 0 messages.

Parameters
socketthe socket for which the operation is now complete
topicthe topic of the QoS 0 write
payloadthe payload of the QoS 0 write
Returns
pointer to the updated queued data structure, or NULL

Definition at line 424 of file SocketBuffer.c.

int SocketBuffer_writeComplete ( int  socket)

A socket write has now completed so we can get rid of the queue

Parameters
socketthe socket for which the operation is now complete
Returns
completion code, boolean - was the queue removed?

Definition at line 411 of file SocketBuffer.c.



plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 04:02:49