Creates an async-io-state which attempts to make a TCP connection.
create-async-io-state-and-connected-tcp-socket collection host service callback &key read-timeout write-timeout user-info connect-timeout local-address local-port keepalive nodelay name queue-output => async-io-state
An integer or a string or an ipv6-address object.
A string or a fixnum.
A function designator for a function of two arguments.
nil
or a positive real.
nil
or a positive real.
A Lisp object.
nil
or a positive real.
nil
, an integer, a string or an ipv6-address object.
nil
, a string or a fixnum.
A generalized boolean.
A generalized boolean.
A boolean.
A Lisp object.
The function create-async-io-state-and-connected-tcp-socket
creates an async-io-state which attempts to make a TCP connection to host on port service within connect-timeout seconds. host and service are interpreted as described in Specifying the target for connecting and binding a socket.
When the connection has been made, callback is called with arguments async-io-state and nil
. Normally callback will start asynchronous I/O by calling async-io-state-read-buffer, async-io-state-write-buffer or async-io-state-read-with-checking. If no connection can be made, callback is called with async-io-state and a list of parameters suitable for calling error
.
local-address and local-port are used to bind the local side of the socket to a particular address and/or port if non-nil.
keepalive and nodelay set the SO_KEEPALIVE and TCP_NODELAY in the socket. The default value of keepalive is nil
. The default value of nodelay is t
.
queue-output controls what happens if you try to perform a write operation on the state while another write operation is ongoing. When nil
, this will cause an error. When non-nil, the second write operation is queued and actually executed later. The default value of queue-output is nil
.
read-timeout, write-timeout and user-info are set in async-io-state.
create-async-io-state
accept-tcp-connections-creating-async-io-states
The Async-I/O-State API
LispWorks User Guide and Reference Manual - 13 Feb 2015