corrected bad specified timeouts (ms versus us) M.Z.
This commit is contained in:
19
network.h
19
network.h
@@ -17,6 +17,8 @@
|
||||
|
||||
Mark Koennecke, October 2001
|
||||
|
||||
Changed all timeout units from microseconds to milliseconds
|
||||
Markus Zolliker August 2004
|
||||
----------------------------------------------------------------------------*/
|
||||
#ifndef NNNET
|
||||
#define NNNET
|
||||
@@ -44,12 +46,12 @@
|
||||
else a valid mkChannel structure for the port
|
||||
*/
|
||||
|
||||
mkChannel *NETAccept(mkChannel *self, int timeout);
|
||||
mkChannel *NETAccept(mkChannel *self, long timeout);
|
||||
/* tries to accept a new connection on the Channel self
|
||||
until timeout. If a connection can be built a new mkChannel
|
||||
structure is returned, else NULL. With a negative value or 0 for
|
||||
timeout this function blocks for an accept.
|
||||
*/
|
||||
*/
|
||||
|
||||
mkChannel *NETConnect(char *name, int port);
|
||||
/* tries to open a client connection to the server specified by name
|
||||
@@ -69,17 +71,18 @@
|
||||
false otherwise.
|
||||
*/
|
||||
|
||||
long NETRead(mkChannel *self, char *buffer, long lLen, int timeout);
|
||||
long NETRead(mkChannel *self, char *buffer, long lLen, long timeout);
|
||||
/* reads data from socket self into buffer with max length lLen
|
||||
waits maximum timeout for data. Returns -1 on error, 0 on no
|
||||
data, and else the length of the data read. With a negative value
|
||||
or 0 for timeout this function blocks for the read.
|
||||
or 0 for timeout this function blocks for the read.
|
||||
*/
|
||||
int NETAvailable(mkChannel *self, int timeout);
|
||||
/*
|
||||
returns 1 if data is pending on the port, 0 if none is
|
||||
int NETAvailable(mkChannel *self, long timeout);
|
||||
/* returns 1 if data is pending on the port, 0 if none is
|
||||
pending.
|
||||
*/
|
||||
int NETReadTillTermNew(mkChannel *self, long timeout,
|
||||
char *pTerm, char *pBuffer, int iBufLen);
|
||||
int NETReadTillTerm(mkChannel *self, int timeout,
|
||||
char *pTerm, char *pBuffer, int iBufLen);
|
||||
/*
|
||||
@@ -91,6 +94,8 @@
|
||||
and a negative value if a network error occurred. Beware that
|
||||
this may not work correctly if the wrong terminator is given.
|
||||
The last one is really needed.
|
||||
In the new version, timeout is in MILLIseconds (10 -3 sec).
|
||||
However, the accuracy is machine dependent (for Linux 10 ms, for Tru64 1 ms)
|
||||
*/
|
||||
/* ********************* KILLING FIELD ******************************** */
|
||||
int NETClosePort(mkChannel *self);
|
||||
|
||||
Reference in New Issue
Block a user