Page 1 of 1

net-receive and wait-string

Posted: Tue Oct 06, 2009 7:05 pm
by Jeff
Does net-receive block while waiting on wait-string if:

1) it is not found before int-max-bytes are read
2) it is not found in the bytes immediately available from the remote socket

If it does block for situation 2, is there any way to evade that behavior while still using the built-in buffer?

Posted: Tue Oct 06, 2009 7:30 pm
by Lutz
When a wait string is specified, it will retry reading the socket until either the wait-string is received or the size specified is read or the sender has no more characters available.

In any case if net-receive could not get the wait-string, it will close the connection, return 'nil' and 'net-error' is set to "Connection closed". You would have to implement any other logic yourself.

Posted: Tue Oct 06, 2009 7:39 pm
by Jeff
Thanks!