Typedefs | |
| typedef void(* | MqEventF )(struct MqS *const ) |
| prototype for a Event-Checking function | |
Enumerations | |
| enum | MqWaitOnEventE { MQ_WAIT_NO = 0, MQ_WAIT_ONCE = 1, MQ_WAIT_FOREVER = 2 } |
| wait for an event? More... | |
Functions | |
| MQ_EXTERN enum MqErrorE | MqProcessEvent (struct MqS *const context, MQ_TIME_T timeout, enum MqWaitOnEventE const wait) |
| Waiting for an incoming packet on all open msgque objects. | |
Variables | |
| enum MqErrorE(* | EventCreateF )(struct MqS *const ) |
| prototype for a Event-Check function | |
the event-queue have to be linked into an existing event-processing infrastructure. the linking is done by defining prototypes for two independent functions:
Tcl_DoOneEvent)Tcl_QueueEvent)
| enum MqWaitOnEventE |
| MQ_EXTERN enum MqErrorE MqProcessEvent | ( | struct MqS *const | context, | |
| MQ_TIME_T | timeout, | |||
| enum MqWaitOnEventE const | wait | |||
| ) |
Waiting for an incoming packet on all open msgque objects.
This function is used to wait for (e.g. MQ_WAIT_ONCE) or check (e.g. MQ_WAIT_NO) for an incoming event. If an event occurs the header of the Msgque packet is parsed and the according service-handle is called. if MQ_WAIT_FOREVER is set the function will never return, accept for an error or on exit. This function is usually used on a server to enter the event-loop and wait for incoming service requests.
| [in] | context | the initial MqS object created by MqContextCreate |
| timeout | time_t type value for timeout in seconds. A value of -1 is used as default using MQ_TIMEOUT seconds. | |
| wait | should the code wait forever (e.g. MQ_WAIT_FOREVER), just wait for the next event (e.g. MQ_WAIT_ONCE) or just return after one single test (MQ_WAIT_NO)" |
... MqErrorCheck(MqLinkCreate(ctx,argv,alfa); ... MqErrorCheck(MqProcessEvent(ctx, MQ_TIMEOUT, MQ_WAIT_FOREVER); ... MqLinkDelete(ctx); ...
Definition at line 1062 of file msgque.c.
References MqLinkS::io, MqS::link, MQ_CONTINUE, MQ_ERROR, MQ_EXIT, MQ_OK, MQ_SELECT_RECV, MQ_TIMEOUT, MQ_TIMEOUT_USER, mq_timeval, MQ_WAIT_FOREVER, MQ_WAIT_ONCE, MqDLogC, MqDLogCL, MqDLogVL, MqErrorCheck, MqErrorStack, MqLogErrorCode(), MqSendEND(), MqSendSTART(), MqSetDebugLevel, pIoGetTimeout(), pIoSelectStart(), pWaitOnEvent(), and sMqEventStart().
Referenced by MqSendEND_AND_WAIT(), pWaitForToken(), sSysServerThreadCreate(), and SysServerFork().

| enum MqErrorE( * EventCreateF)(struct MqS *const ) |
prototype for a Event-Check function
This function is called by the libmsgque_private event-loop as idle-task in MqProcessEvent
1.5.8