summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-03-15 04:47:16 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-03-15 04:47:16 -0700
commit6737b7efe2f4ef7ad4e8f6b2716ada469ef3913d (patch)
treee6c487eb0ff6377f33b4d5beed95c64c2c523508 /txr.1
parentb5a234ce8479e609e6153b5bec106504d4a740c1 (diff)
downloadtxr-6737b7efe2f4ef7ad4e8f6b2716ada469ef3913d.tar.gz
txr-6737b7efe2f4ef7ad4e8f6b2716ada469ef3913d.tar.bz2
txr-6737b7efe2f4ef7ad4e8f6b2716ada469ef3913d.zip
Implement socket timeouts.
* lib.c (timeout_error_s): New symbol variable. (obj_init): Intern timeout-error, init new variable. * lib.h (timeout_error_s): Declared. * socket.c (sock_timeout, sock_send_timeout, sock_recv_timeout): New static functions. (sock_load_init): Register sock-send-timeout and sock-recv-timeout intrinsics. * stream.c (stdio_maybe_read_error, stdio_maybe_error): Convert EAGAIN into timeout_error_s. * txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.133
1 files changed, 33 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 19f1ba54..de3b5103 100644
--- a/txr.1
+++ b/txr.1
@@ -37990,6 +37990,39 @@ Shutting down in the reading direction is potentially abrupt. If it is executed
before an "end of stream" indication is received from a peer, it results in an
abortive close.
+.coNP Functions @ sock-recv-timeout and @ sock-send-timeout
+.synb
+.mets (sock-recv-timeout < sock << usec )
+.mets (sock-send-timeout < sock << usec )
+.syne
+.desc
+The
+.code sock-recv-timeout
+and
+.code sock-send-timeout
+functions configure, respectively, receive and send timeouts on socket
+.metn sock .
+
+The
+.meta usec
+parameter specifies the value, in microseconds. It must be a
+.code fixnum
+integer.
+
+When a receive timeout is configured on a socket, then an
+exception of type
+.code timeout-error
+is thrown when an input operation waits for at least
+.code usec
+microseconds without receiving input.
+
+Similarly, when a send timeout is configured, then an
+exception of type
+.code timeout-error
+is thrown when an output operation waits for at least
+.code usec
+microseconds for the availability of buffer space in the socket.
+
.coNP Functions @ str-inaddr and @ str-in6addr
.synb
.mets (str-inaddr address <> [ port ])