45#include <BaSocketConfig.h>
101 void operator delete(
void* d) {
if(d)
::baFree(d); }
102 void *
operator new(size_t,
void *place) {
return place; }
103 void operator delete(
void*,
void *) { }
187#ifndef SoDisp_destructor
188#define SoDisp_destructor(o)
199#if !BA_HAVE_SOCKET_WRITE_EVENTS
200#define SoDisp_activateSend(o, con)
201#define SoDisp_deactivateSend(o, con)
217union SIGNAL* SoDisp_receive(
SoDisp* o,
S32 time, SIGSELECT* sel);
221#define SoDisp_getMutex(o) ((o) ? ((o)->mutex) : 0)
224#define SoDisp_mutexSet(o) ThreadMutex_set((o)->mutex)
227#define SoDisp_mutexRelease(o) ThreadMutex_release((o)->mutex)
230#define SoDisp_setExit(o) (o)->doExit=TRUE
245 SoDisp_activateSend(
this, con); }
247 SoDisp_deactivateSend(
this, con); }
253 return this->mutex; }
255inline union SIGNAL* SoDisp::receive(
S32 time, SIGSELECT* sel) {
256 return SoDisp_receive(
this, time, sel); }
264void SoDisp_setTimeout(
265 SoDisp* o,
BaTime t,
void (*cb)(
void*
object),
void*
object);
BA_API void SoDisp_run(SoDisp *o, S32 timeout)
Run the generic socket dispatcher loop.
BA_API void SoDisp_activateRec(SoDisp *o, struct SoDispCon *con)
Enable receive events.
#define SoDisp_mutexRelease(o)
Release the configured mutex owned by this thread.
Definition: SoDisp.h:227
#define SoDisp_mutexSet(o)
Acquire the configured mutex; do not acquire recursively.
Definition: SoDisp.h:224
BA_API void SoDisp_constructor(SoDisp *o, ThreadMutex *mutex)
The constructor.
BA_API void SoDisp_removeConnection(SoDisp *o, struct SoDispCon *con)
Unregister a connection without closing or freeing it.
BA_API void SoDisp_deactivateRec(SoDisp *o, struct SoDispCon *con)
Disable receive events without closing or unregistering the connection.
struct SoDisp SoDisp
The SoDisp dispatches any socket connection that contains data by calling the SoDispCon::execute memb...
#define SoDisp_setExit(o)
Definition: SoDisp.h:230
BA_API void SoDisp_addConnection(SoDisp *o, struct SoDispCon *con)
Register a connection without enabling events.
void * baMalloc(size_t size)
Allocate uninitialized storage using the target's configured allocator.
void baFree(void *p)
Release storage using the target's configured allocator.
int32_t S32
Signed 32-bit integer.
Definition: GenPrimT.h:88
S64 BaTime
An arithmetic type representing calendar time with epoch of 1970-01-01 00:00:00 UTC,...
Definition: GenPrimT.h:106
U8 BaBool
Boolean stored in an unsigned byte; FALSE is zero and TRUE is one.
Definition: GenPrimT.h:121
Route and process HTTP requests using a borrowed dispatcher.
Definition: HttpServer.h:3464
Contains information about the physical socket connection.
Definition: SoDispCon.h:120
The SoDisp dispatches any socket connection that contains data by calling the SoDispCon::execute memb...
Definition: SoDisp.h:97
void mutexRelease()
Release the mutex currently owned by this thread.
Definition: SoDisp.h:259
void run(S32 timeout=-1)
Run the generic socket dispatcher loop.
Definition: SoDisp.h:250
void activateRec(SoDispCon *con)
Enable receive events.
Definition: SoDisp.h:240
SoDisp(ThreadMutex *mutex)
The constructor.
Definition: SoDisp.h:236
void setExit()
Request that the current run loop exits after it regains control.
Definition: SoDisp.h:260
void activateSend(SoDispCon *con)
Enable send-ready events.
Definition: SoDisp.h:244
void addConnection(SoDispCon *con)
Register a connection without enabling events.
Definition: SoDisp.h:238
void mutexSet()
Lock the dispatcher thread.
Definition: SoDisp.h:258
void removeConnection(SoDispCon *con)
Unregister a connection without closing or freeing it.
Definition: SoDisp.h:248
ThreadMutex * getMutex()
Definition: SoDisp.h:252
void deactivateRec(SoDispCon *con)
Disable receive events without closing or unregistering the connection.
Definition: SoDisp.h:242
void deactivateSend(SoDispCon *con)
Disable send-ready events without closing or unregistering the connection.
Definition: SoDisp.h:246
A mutual exclusion class.
Definition: ThreadLib.h:196