Files
sics/nwatch.h
Douglas Clowes e90d45da8c Make timers use milliseconds instead of microseconds
r1505 | dcl | 2007-02-19 12:24:40 +1100 (Mon, 19 Feb 2007) | 2 lines
2012-11-15 12:59:50 +11:00

34 lines
963 B
C

/*
* N E T W A T C H E R
*
* This module watches network connections for sockets becoming readable or
* writeable and invokes callbacks. It also provides a timer mechanism.
*
* Douglas Clowes, February 2007
*
*/
#ifndef SICSNETWATCHER
#define SICSNETWATCHER
#define DFC_NWATCH 1
#define nwatch_read 1
#define nwatch_write 2
/* the callback function */
typedef int (*pNWCallback)(void* context, int mode);
/* the timer methods */
typedef struct __netwatchtimer *pNWTimer;
int NetWatchRegisterTimer(pNWTimer* handle, int mSec,
pNWCallback callback, void* context);
int NetWatchRemoveTimer(pNWTimer handle);
/* the socket methods */
typedef struct __netwatchcontext *pNWContext;
int NetWatchRegisterCallback(pNWContext* handle, int iSocket,
pNWCallback callback, void* context);
int NetWatchRemoveCallback(pNWContext handle);
int NetWatchGetMode(pNWContext handle);
int NetWatchSetMode(pNWContext handle, int mode);
#endif /* SICSNETWATCHER */