net-receive and wait-string

Q&A's, tips, howto's
Locked
Jeff
Posts: 604
Joined: Sat Apr 07, 2007 2:23 pm
Location: Ohio
Contact:

net-receive and wait-string

Post 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?
Jeff
=====
Old programmers don't die. They just parse on...

Artful code

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post 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.

Jeff
Posts: 604
Joined: Sat Apr 07, 2007 2:23 pm
Location: Ohio
Contact:

Post by Jeff »

Thanks!
Jeff
=====
Old programmers don't die. They just parse on...

Artful code

Locked