S2OPC OPCUA Toolkit
Loading...
Searching...
No Matches
sopc_sub_sockets_mgr.h File Reference
#include "sopc_raw_sockets.h"

Go to the source code of this file.

Data Structures

struct  SOPC_Sub_Sockets_Timeout
 

Typedefs

typedef void SOPC_ReadyToReceive(void *sockContext, SOPC_Socket sock)
 
typedef void SOPC_Sub_Sockets_Timeout_Cb(void *ctx)
 
typedef struct SOPC_Sub_Sockets_Timeout SOPC_Sub_Sockets_Timeout
 

Functions

void SOPC_Sub_SocketsMgr_Initialize (void *sockContextArray, size_t sizeOfSockContextElt, SOPC_Socket *socketArray, uint16_t nbSockets, SOPC_ReadyToReceive *pCallback, const SOPC_Sub_Sockets_Timeout *pTimeout, int threadPriority)
 
void SOPC_Sub_SocketsMgr_Clear (void)
 

Typedef Documentation

◆ SOPC_ReadyToReceive

typedef void SOPC_ReadyToReceive(void *sockContext, SOPC_Socket sock)

◆ SOPC_Sub_Sockets_Timeout_Cb

typedef void SOPC_Sub_Sockets_Timeout_Cb(void *ctx)

◆ SOPC_Sub_Sockets_Timeout

typedef struct SOPC_Sub_Sockets_Timeout SOPC_Sub_Sockets_Timeout

Function Documentation

◆ SOPC_Sub_SocketsMgr_Initialize()

void SOPC_Sub_SocketsMgr_Initialize ( void * sockContextArray,
size_t sizeOfSockContextElt,
SOPC_Socket * socketArray,
uint16_t nbSockets,
SOPC_ReadyToReceive * pCallback,
const SOPC_Sub_Sockets_Timeout * pTimeout,
int threadPriority )

Initialize the sockets manager for the given sockets (with custom context), the data received callback and tick callback (to check keep alive timeout). A dedicated thread is started to check when sockets have data to read and to call the periodic callback.

Parameters
sockContextArrayarray of context (shall have nbSockets elements)
sizeOfSockContextEltsize of an element of context in sockContextArray
socketArrayarray of sockets defined to receive data as subscriber (shall have nbSockets elements)
nbSocketsthe number of sockets (and sockets context)
pCallbackthe callback called when a socket has data to read available, socket and its associated context are provided by caller
pTimeoutThe timeout configuration. Can be NULL if no timeout is configured
threadPriorityThis value must be 0 (thread created with usual priority) or 1 to 99 (thread created with FIFO scheduling policy requiring administrative rights)

◆ SOPC_Sub_SocketsMgr_Clear()

void SOPC_Sub_SocketsMgr_Clear ( void )

Awaits the dedicated thread to stop, clear the context and return.