- allow empty terminator in NETReadTillTermNew
- introduced NETReadFinished and NETConnectWithFlags
This commit is contained in:
19
network.h
19
network.h
@@ -58,6 +58,18 @@
|
||||
and port. Returns NULL on failure, a struct else
|
||||
*/
|
||||
|
||||
mkChannel *NETConnectWithFlags(char *name, int port, int flags);
|
||||
/* the same as NETConnect, but with flags:
|
||||
if (flags & 1): do not block on connect (use NETConnectFinished
|
||||
to check success)
|
||||
if (flags & 2): wait 1000 ms after last close (workaround for
|
||||
a bug in Lantronix terminal server
|
||||
*/
|
||||
|
||||
int NETConnectFinished(mkChannel *self);
|
||||
/* returns 0 if in progress, 1 on success, a negative value on error
|
||||
*/
|
||||
|
||||
int NETInfo(mkChannel *self, char *pComposter, int iBufLen);
|
||||
/* Once a socket is connected it is possible to figure out
|
||||
which host the connection came from. Maximum iBufLen characters
|
||||
@@ -90,12 +102,15 @@
|
||||
been found. The data is copied into the buffer pBuffer. A
|
||||
maximum length of iBufLen characters is observed. The timeout
|
||||
parameter defines a maximum time to wait for a terminator to
|
||||
appear. NETReadTillTerm returns 1 on success, 0 on a timeout,
|
||||
appear. NETReadTillTerm returns the number of characters read
|
||||
(including terminator) on success, 0 on a timeout,
|
||||
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)
|
||||
However, the accuracy is machine dependent (for Linux 10 ms, for Tru64 1 ms)
|
||||
If no terminator is given, the routine waits for iBufLen characters
|
||||
or timeout.
|
||||
*/
|
||||
/* ********************* KILLING FIELD ******************************** */
|
||||
int NETClosePort(mkChannel *self);
|
||||
|
||||
Reference in New Issue
Block a user