gwenhywfar  5.14.1
Macros | Functions
endpoint_msgio.c File Reference
#include "./endpoint_msgio_p.h"
#include <gwenhywfar/debug.h>
Include dependency graph for endpoint_msgio.c:

Go to the source code of this file.

Macros

#define GWEN_ENDPOINT_MSGIO_BUFFERSIZE   1024
 

Functions

static void _addSockets (GWEN_MSG_ENDPOINT *ep, GWEN_SOCKETSET *readSet, GWEN_SOCKETSET *writeSet, GWEN_UNUSED GWEN_SOCKETSET *xSet)
 
static void _checkSockets (GWEN_MSG_ENDPOINT *ep, GWEN_SOCKETSET *readSet, GWEN_SOCKETSET *writeSet, GWEN_SOCKETSET *xSet)
 
static int _distributeBufferContent (GWEN_MSG_ENDPOINT *ep, const uint8_t *bufferPtr, int bufferLen)
 
static void GWENHYWFAR_CB _freeData (void *bp, void *p)
 
static int _readCurrentMessage (GWEN_MSG_ENDPOINT *ep)
 
static void _sendMsgFinish (GWEN_MSG_ENDPOINT *ep, GWEN_MSG *msg)
 
static int _sendMsgStart (GWEN_MSG_ENDPOINT *ep, GWEN_MSG *msg)
 
static int _writeCurrentMessage (GWEN_MSG_ENDPOINT *ep)
 
void GWEN_MsgIoEndpoint_Extend (GWEN_MSG_ENDPOINT *ep)
 
void GWEN_MsgIoEndpoint_SetGetNeededBytesFn (GWEN_MSG_ENDPOINT *ep, GWEN_ENDPOINT_MSGIO_GETBYTESNEEDED_FN f)
 
void GWEN_MsgIoEndpoint_SetSendMsgFinishFn (GWEN_MSG_ENDPOINT *ep, GWEN_ENDPOINT_MSGIO_SENDMSGFINISH_FN f)
 
void GWEN_MsgIoEndpoint_SetSendMsgStartFn (GWEN_MSG_ENDPOINT *ep, GWEN_ENDPOINT_MSGIO_SENDMSGSTART_FN f)
 

Macro Definition Documentation

◆ GWEN_ENDPOINT_MSGIO_BUFFERSIZE

#define GWEN_ENDPOINT_MSGIO_BUFFERSIZE   1024

Definition at line 21 of file endpoint_msgio.c.

Referenced by _readCurrentMessage().

Function Documentation

◆ _addSockets()

void _addSockets ( GWEN_MSG_ENDPOINT ep,
GWEN_SOCKETSET readSet,
GWEN_SOCKETSET writeSet,
GWEN_UNUSED GWEN_SOCKETSET xSet 
)
static

◆ _checkSockets()

void _checkSockets ( GWEN_MSG_ENDPOINT ep,
GWEN_SOCKETSET readSet,
GWEN_SOCKETSET writeSet,
GWEN_SOCKETSET xSet 
)
static

◆ _distributeBufferContent()

int _distributeBufferContent ( GWEN_MSG_ENDPOINT ep,
const uint8_t *  bufferPtr,
int  bufferLen 
)
static

◆ _freeData()

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

Definition at line 64 of file endpoint_msgio.c.

References GWEN_FREE_OBJECT, and GWEN_MsgEndpoint_SetCheckSocketsFn().

Referenced by GWEN_MsgIoEndpoint_Extend().

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

◆ _readCurrentMessage()

int _readCurrentMessage ( GWEN_MSG_ENDPOINT ep)
static

Definition at line 290 of file endpoint_msgio.c.

References _distributeBufferContent(), DBG_DEBUG, DBG_INFO, GWEN_ENDPOINT_MSGIO_BUFFERSIZE, GWEN_ERROR_IO, GWEN_ERROR_TIMEOUT, GWEN_LOGDOMAIN, GWEN_MsgEndpoint_GetName(), and GWEN_MsgEndpoint_ReadFromSocket().

Referenced by _checkSockets().

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

◆ _sendMsgFinish()

void _sendMsgFinish ( GWEN_MSG_ENDPOINT ep,
GWEN_MSG msg 
)
static

Definition at line 131 of file endpoint_msgio.c.

References GWEN_INHERIT_GETDATA.

Referenced by _writeCurrentMessage().

Here is the caller graph for this function:

◆ _sendMsgStart()

int _sendMsgStart ( GWEN_MSG_ENDPOINT ep,
GWEN_MSG msg 
)
static

Definition at line 116 of file endpoint_msgio.c.

References GWEN_INHERIT_GETDATA.

Referenced by _writeCurrentMessage().

Here is the caller graph for this function:

◆ _writeCurrentMessage()

int _writeCurrentMessage ( GWEN_MSG_ENDPOINT ep)
static

◆ GWEN_MsgIoEndpoint_Extend()

void GWEN_MsgIoEndpoint_Extend ( GWEN_MSG_ENDPOINT ep)

Create a base class for message based endpoints (which are basically all endpoints). It contains code to automatically read and write messages from/to the internal queues (see GWEN_MsgEndpoint_GetReceivedMessageList and GWEN_MsgEndpoint_GetSendMessageList).

For this class to work with every type of message protocol a callback must be set via GWEN_MsgIoEndpoint_SetGetNeededBytesFn.

Definition at line 51 of file endpoint_msgio.c.

References _addSockets(), _checkSockets(), _freeData(), GWEN_INHERIT_SETDATA, GWEN_MsgEndpoint_SetAddSocketsFn(), GWEN_MsgEndpoint_SetCheckSocketsFn(), and GWEN_NEW_OBJECT.

Referenced by GWEN_IpcEndpoint_CreateIpcTcpClient(), and GWEN_IpcEndpoint_CreateIpcTcpServiceForSocket().

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

◆ GWEN_MsgIoEndpoint_SetGetNeededBytesFn()

void GWEN_MsgIoEndpoint_SetGetNeededBytesFn ( GWEN_MSG_ENDPOINT ep,
GWEN_ENDPOINT_MSGIO_GETBYTESNEEDED_FN  f 
)

Definition at line 77 of file endpoint_msgio.c.

References GWEN_INHERIT_GETDATA.

Referenced by GWEN_IpcEndpoint_Extend().

Here is the caller graph for this function:

◆ GWEN_MsgIoEndpoint_SetSendMsgFinishFn()

void GWEN_MsgIoEndpoint_SetSendMsgFinishFn ( GWEN_MSG_ENDPOINT ep,
GWEN_ENDPOINT_MSGIO_SENDMSGFINISH_FN  f 
)

Definition at line 103 of file endpoint_msgio.c.

References GWEN_INHERIT_GETDATA.

◆ GWEN_MsgIoEndpoint_SetSendMsgStartFn()

void GWEN_MsgIoEndpoint_SetSendMsgStartFn ( GWEN_MSG_ENDPOINT ep,
GWEN_ENDPOINT_MSGIO_SENDMSGSTART_FN  f 
)

Definition at line 90 of file endpoint_msgio.c.

References GWEN_INHERIT_GETDATA.