gwenhywfar 5.12.0
endpoint_multilayer.c File Reference
#include "./endpoint_multilayer_p.h"
#include <gwenhywfar/endpoint.h>
#include <gwenhywfar/debug.h>
#include <gwenhywfar/inherit.h>
Include dependency graph for endpoint_multilayer.c:

Go to the source code of this file.

Macros

#define GWEN_ENDPOINT_MULTILAYER_DEFAULT_CONNECT_TIMEOUT   10
#define GWEN_ENDPOINT_MULTILAYER_DEFAULT_RECONNECT_TIME   5
#define GWEN_ENDPOINT_MULTILAYER_NAME   "multilayer"

Functions

void _addSockets (GWEN_MSG_ENDPOINT *ep, GWEN_SOCKETSET *readSet, GWEN_SOCKETSET *writeSet, GWEN_SOCKETSET *xSet)
static void _addSockets (GWEN_MSG_ENDPOINT *ep, GWEN_SOCKETSET *readSet, GWEN_SOCKETSET *writeSet, GWEN_UNUSED GWEN_SOCKETSET *xSet)
static void _addSocketsWhenConnected (GWEN_MSG_ENDPOINT *ep, GWEN_MSG_ENDPOINT *epChild, GWEN_SOCKETSET *readSet, GWEN_SOCKETSET *writeSet, GWEN_SOCKETSET *xSet)
static void _addSocketsWhenConnecting (GWEN_MSG_ENDPOINT *ep, GWEN_MSG_ENDPOINT *epChild, GWEN_SOCKETSET *readSet, GWEN_SOCKETSET *writeSet, GWEN_SOCKETSET *xSet)
static void _checkForNeedToReconnect (GWEN_MSG_ENDPOINT *ep)
static void _checkSockets (GWEN_MSG_ENDPOINT *ep, GWEN_SOCKETSET *readSet, GWEN_SOCKETSET *writeSet, GWEN_SOCKETSET *xSet)
static void _checkSocketsWhenConnected (GWEN_MSG_ENDPOINT *ep, GWEN_MSG_ENDPOINT *epChild, GWEN_SOCKETSET *readSet, GWEN_SOCKETSET *writeSet, GWEN_SOCKETSET *xSet)
static void _checkSocketsWhenConnecting (GWEN_MSG_ENDPOINT *ep, GWEN_MSG_ENDPOINT *epChild, GWEN_SOCKETSET *readSet, GWEN_SOCKETSET *writeSet, GWEN_SOCKETSET *xSet)
void GWENHYWFAR_CB _freeData (GWEN_UNUSED void *bp, void *p)
static void GWENHYWFAR_CB _freeData (void *bp, void *p)
static void _moveMessagesBetweenLists (GWEN_MSG_LIST *srcList, GWEN_MSG_LIST *dstList)
static int _startConnect (GWEN_MSG_ENDPOINT *ep)
 GWEN_INHERIT (GWEN_MSG_ENDPOINT, GWEN_ENDPOINT_MULTILAYER)
int GWEN_MultilayerEndpoint_GetConnectTimeoutInSeconds (const GWEN_MSG_ENDPOINT *ep)
int GWEN_MultilayerEndpoint_GetReconnectTimeInSeconds (const GWEN_MSG_ENDPOINT *ep)
int GWEN_MultilayerEndpoint_GetStage (const GWEN_MSG_ENDPOINT *ep)
GWEN_MSG_ENDPOINTGWEN_MultilayerEndpoint_new (const char *name, int groupId)
GWEN_ENDPOINT_MULTILAYER_CHECKSOCKETS_FN GWEN_MultilayerEndpoint_SetCheckSocketsFn (GWEN_MSG_ENDPOINT *ep, GWEN_ENDPOINT_MULTILAYER_CHECKSOCKETS_FN fn)
void GWEN_MultilayerEndpoint_SetConnectTimeoutInSeconds (GWEN_MSG_ENDPOINT *ep, int i)
void GWEN_MultilayerEndpoint_SetReconnectTimeInSeconds (GWEN_MSG_ENDPOINT *ep, int i)
void GWEN_MultilayerEndpoint_SetStage (GWEN_MSG_ENDPOINT *ep, int i)
GWEN_ENDPOINT_MULTILAYER_STARTCONNECT_FN GWEN_MultilayerEndpoint_SetStartConnectFn (GWEN_MSG_ENDPOINT *ep, GWEN_ENDPOINT_MULTILAYER_STARTCONNECT_FN fn)
int GWEN_MultilayerEndpoint_StartConnect (GWEN_MSG_ENDPOINT *ep)

Macro Definition Documentation

◆ GWEN_ENDPOINT_MULTILAYER_DEFAULT_CONNECT_TIMEOUT

#define GWEN_ENDPOINT_MULTILAYER_DEFAULT_CONNECT_TIMEOUT   10

◆ GWEN_ENDPOINT_MULTILAYER_DEFAULT_RECONNECT_TIME

#define GWEN_ENDPOINT_MULTILAYER_DEFAULT_RECONNECT_TIME   5

◆ GWEN_ENDPOINT_MULTILAYER_NAME

#define GWEN_ENDPOINT_MULTILAYER_NAME   "multilayer"

Definition at line 23 of file endpoint_multilayer.c.

Referenced by GWEN_MultilayerEndpoint_new().

Function Documentation

◆ _addSockets() [1/2]

◆ _addSockets() [2/2]

◆ _addSocketsWhenConnected()

void _addSocketsWhenConnected ( GWEN_MSG_ENDPOINT * ep,
GWEN_MSG_ENDPOINT * epChild,
GWEN_SOCKETSET * readSet,
GWEN_SOCKETSET * writeSet,
GWEN_SOCKETSET * xSet )
static

Definition at line 341 of file endpoint_multilayer.c.

References _moveMessagesBetweenLists(), DBG_ERROR, GWEN_LOGDOMAIN, GWEN_MSG_ENDPOINT_STATE_UNCONNECTED, GWEN_MsgEndpoint_AddSockets(), GWEN_MsgEndpoint_Disconnect(), GWEN_MsgEndpoint_GetSendMessageList(), and GWEN_MsgEndpoint_GetState().

Referenced by _addSockets().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _addSocketsWhenConnecting()

void _addSocketsWhenConnecting ( GWEN_MSG_ENDPOINT * ep,
GWEN_MSG_ENDPOINT * epChild,
GWEN_SOCKETSET * readSet,
GWEN_SOCKETSET * writeSet,
GWEN_SOCKETSET * xSet )
static

◆ _checkForNeedToReconnect()

void _checkForNeedToReconnect ( GWEN_MSG_ENDPOINT * ep)
static

Definition at line 304 of file endpoint_multilayer.c.

References DBG_INFO, GWEN_ERROR_IN_PROGRESS, GWEN_LOGDOMAIN, GWEN_MsgEndpoint_GetTimeOfLastStateChange(), GWEN_MultilayerEndpoint_GetReconnectTimeInSeconds(), GWEN_MultilayerEndpoint_StartConnect(), and NULL.

Referenced by _addSockets().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _checkSockets()

◆ _checkSocketsWhenConnected()

void _checkSocketsWhenConnected ( GWEN_MSG_ENDPOINT * ep,
GWEN_MSG_ENDPOINT * epChild,
GWEN_SOCKETSET * readSet,
GWEN_SOCKETSET * writeSet,
GWEN_SOCKETSET * xSet )
static

Definition at line 358 of file endpoint_multilayer.c.

References _moveMessagesBetweenLists(), GWEN_MsgEndpoint_CheckSockets(), GWEN_MsgEndpoint_GetReceivedMessageList(), and GWEN_MsgEndpoint_GetSendMessageList().

Referenced by _checkSockets().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _checkSocketsWhenConnecting()

void _checkSocketsWhenConnecting ( GWEN_MSG_ENDPOINT * ep,
GWEN_MSG_ENDPOINT * epChild,
GWEN_SOCKETSET * readSet,
GWEN_SOCKETSET * writeSet,
GWEN_SOCKETSET * xSet )
static

Definition at line 402 of file endpoint_multilayer.c.

References GWEN_INHERIT_GETDATA, and GWEN_MsgEndpoint_CheckSockets().

Referenced by _checkSockets().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _freeData() [1/2]

void GWENHYWFAR_CB _freeData ( GWEN_UNUSED void * bp,
void * p )

Definition at line 83 of file endpoint_multilayer.c.

References GWEN_FREE_OBJECT, GWEN_UNUSED, and GWENHYWFAR_CB.

◆ _freeData() [2/2]

void GWENHYWFAR_CB _freeData ( void * bp,
void * p )
static

References GWEN_UNUSED, and GWENHYWFAR_CB.

◆ _moveMessagesBetweenLists()

void _moveMessagesBetweenLists ( GWEN_MSG_LIST * srcList,
GWEN_MSG_LIST * dstList )
static

Definition at line 369 of file endpoint_multilayer.c.

References GWEN_Msg_List_Add(), GWEN_Msg_List_Del(), and GWEN_Msg_List_First().

Referenced by _addSocketsWhenConnected(), and _checkSocketsWhenConnected().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _startConnect()

int _startConnect ( GWEN_MSG_ENDPOINT * ep)
static

Definition at line 383 of file endpoint_multilayer.c.

References GWEN_ERROR_GENERIC, and GWEN_INHERIT_GETDATA.

Referenced by GWEN_MultilayerEndpoint_StartConnect().

Here is the caller graph for this function:

◆ GWEN_INHERIT()

GWEN_INHERIT ( GWEN_MSG_ENDPOINT ,
GWEN_ENDPOINT_MULTILAYER  )

◆ GWEN_MultilayerEndpoint_GetConnectTimeoutInSeconds()

int GWEN_MultilayerEndpoint_GetConnectTimeoutInSeconds ( const GWEN_MSG_ENDPOINT * ep)

Definition at line 120 of file endpoint_multilayer.c.

References GWEN_ENDPOINT_MULTILAYER_DEFAULT_CONNECT_TIMEOUT, and GWEN_INHERIT_GETDATA.

Referenced by _addSocketsWhenConnecting().

Here is the caller graph for this function:

◆ GWEN_MultilayerEndpoint_GetReconnectTimeInSeconds()

int GWEN_MultilayerEndpoint_GetReconnectTimeInSeconds ( const GWEN_MSG_ENDPOINT * ep)

Definition at line 93 of file endpoint_multilayer.c.

References GWEN_ENDPOINT_MULTILAYER_DEFAULT_RECONNECT_TIME, and GWEN_INHERIT_GETDATA.

Referenced by _checkForNeedToReconnect().

Here is the caller graph for this function:

◆ GWEN_MultilayerEndpoint_GetStage()

int GWEN_MultilayerEndpoint_GetStage ( const GWEN_MSG_ENDPOINT * ep)

Definition at line 147 of file endpoint_multilayer.c.

References GWEN_INHERIT_GETDATA.

◆ GWEN_MultilayerEndpoint_new()

◆ GWEN_MultilayerEndpoint_SetCheckSocketsFn()

Definition at line 195 of file endpoint_multilayer.c.

References GWEN_INHERIT_GETDATA, and NULL.

◆ GWEN_MultilayerEndpoint_SetConnectTimeoutInSeconds()

void GWEN_MultilayerEndpoint_SetConnectTimeoutInSeconds ( GWEN_MSG_ENDPOINT * ep,
int i )

Definition at line 134 of file endpoint_multilayer.c.

References GWEN_INHERIT_GETDATA.

◆ GWEN_MultilayerEndpoint_SetReconnectTimeInSeconds()

void GWEN_MultilayerEndpoint_SetReconnectTimeInSeconds ( GWEN_MSG_ENDPOINT * ep,
int i )

Definition at line 107 of file endpoint_multilayer.c.

References GWEN_INHERIT_GETDATA.

◆ GWEN_MultilayerEndpoint_SetStage()

void GWEN_MultilayerEndpoint_SetStage ( GWEN_MSG_ENDPOINT * ep,
int i )

Definition at line 161 of file endpoint_multilayer.c.

References GWEN_INHERIT_GETDATA.

◆ GWEN_MultilayerEndpoint_SetStartConnectFn()

Definition at line 174 of file endpoint_multilayer.c.

References GWEN_INHERIT_GETDATA, and NULL.

◆ GWEN_MultilayerEndpoint_StartConnect()

int GWEN_MultilayerEndpoint_StartConnect ( GWEN_MSG_ENDPOINT * ep)