20#ifndef SOPC_SOCKETS_INTERNAL_CTX_H_
21#define SOPC_SOCKETS_INTERNAL_CTX_H_
An asynchronous and thread-safe queue implementation.
struct SOPC_AsyncQueue SOPC_AsyncQueue
Definition sopc_async_queue.h:31
enum _SOPC_ReturnStatus SOPC_ReturnStatus
Common enumerations for S2OPC.
struct _SOPC_EventHandler SOPC_EventHandler
Processes messages from a queue.
Definition sopc_event_handler.h:35
A platform independent API to use sockets.
Event oriented API of the Services layer.
SOPC_Sockets_OutputEvent
Definition sopc_sockets_api.h:75
SOPC_Sockets_InputEvent
Definition sopc_sockets_api.h:37
void SOPC_SocketsInternalContext_Clear(void)
Clear the array of sockets.
SOPC_Socket_State
Definition sopc_sockets_internal_ctx.h:33
@ SOCKET_STATE_LISTENING
Definition sopc_sockets_internal_ctx.h:39
@ SOCKET_STATE_CONNECTING
Definition sopc_sockets_internal_ctx.h:35
@ SOCKET_STATE_CLOSED
Definition sopc_sockets_internal_ctx.h:34
@ SOCKET_STATE_ACCEPTED
Definition sopc_sockets_internal_ctx.h:40
@ SOCKET_STATE_CONNECTED
Definition sopc_sockets_internal_ctx.h:37
SOPC_ReturnStatus SOPC_Sockets_EnqueueInputEvent(SOPC_Sockets_InputEvent socketEvent, uint32_t id, uintptr_t params, uintptr_t auxParam)
Enqueues an input event to the queue of events managed by the socket event manager.
void SOPC_Sockets_Emit(SOPC_Sockets_OutputEvent event, uint32_t eltId, uintptr_t params, uintptr_t auxParam)
Emits an output event to the recorded output event handler socketsEventHandler.
SOPC_InternalSocket * SOPC_SocketsInternalContext_GetFreeSocket(bool isListener)
Returns an unused socket from the array of sockets or NULL if none available In case socket is not a ...
SOPC_EventHandler * socketsEventHandler
struct SOPC_InternalSocket SOPC_InternalSocket
SOPC_InternalSocket socketsArray[SOPC_MAX_SOCKETS]
Array containing all sockets that can be used.
void SOPC_SocketsInternalContext_Initialize(void)
Initialize the array of sockets.
SOPC_ReturnStatus SOPC_Sockets_DequeueAndDispatchInputEvent(void)
Dequeues an input event of the queue of events and call the event dispatcher of the socket event mana...
void SOPC_SocketsInternalContext_CloseSocket(uint32_t socketIdx)
Close the socket and set it as not used anymore.
Definition sopc_sockets_internal_ctx.h:44
bool isServerConnection
Definition sopc_sockets_internal_ctx.h:54
uint32_t connectionId
Definition sopc_sockets_internal_ctx.h:46
uint32_t listenerConnections
Definition sopc_sockets_internal_ctx.h:61
void * curConnectAttemptAddr
Definition sopc_sockets_internal_ctx.h:58
void * connectAddrs
Definition sopc_sockets_internal_ctx.h:57
SOPC_Socket_Address * addr
Definition sopc_sockets_internal_ctx.h:65
bool isNotWritable
Definition sopc_sockets_internal_ctx.h:51
SOPC_Socket_State state
Definition sopc_sockets_internal_ctx.h:55
bool isUsed
Definition sopc_sockets_internal_ctx.h:52
SOPC_AsyncQueue * writeQueue
Definition sopc_sockets_internal_ctx.h:50
uint32_t socketIdx
Definition sopc_sockets_internal_ctx.h:45
uint32_t listenerSocketIdx
Definition sopc_sockets_internal_ctx.h:63
void * nextConnectAttemptAddr
Definition sopc_sockets_internal_ctx.h:59
SOPC_Socket sock
Definition sopc_sockets_internal_ctx.h:49
Socket address information on a connected socket.
Definition p_sopc_sockets.h:55
Socket base type.
Definition p_sopc_sockets.h:36