*** empty log message ***
This commit is contained in:
35
tecs/server.h
Normal file
35
tecs/server.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#include "coc.h"
|
||||
|
||||
struct CocClient { struct CocClient *next; int fd; int mode; char cmd[80]; char res[80]; };
|
||||
|
||||
int CocInitServer(int bufsize, int port);
|
||||
|
||||
int CocHandleRequests(int tmo_msec, int fd);
|
||||
int CocHandle1Request(int tmo_msec, int fd);
|
||||
/*
|
||||
handle hetwork requests.
|
||||
|
||||
return value: <0: error
|
||||
=0: error
|
||||
=1: event on fd
|
||||
=2: variable was changed
|
||||
=3: other network request treated
|
||||
|
||||
CocHandle1Request handles only one network request
|
||||
|
||||
For CocHandleRequests:
|
||||
|
||||
if fd=0: returns when a network request has changed a variable,
|
||||
or when timeout has expired
|
||||
|
||||
if fd>0: returns when an read event is pending on fd
|
||||
or when timeout has expired
|
||||
|
||||
*/
|
||||
|
||||
struct CocClient *CocGetNextCmd();
|
||||
/*
|
||||
get next client with a pending command
|
||||
*/
|
||||
|
||||
void CocCloseServer();
|
||||
Reference in New Issue
Block a user