All Manuals > LispWorks User Guide and Reference Manual > 32 The COMM Package

NextPrevUpTopContentsIndex

create-async-io-state

Function
Summary

Creates an async-io-state for a socket.

Package

comm

Signature

create-async-io-state collection object &key read-timeout write-timeout user-info udp ipv6 name queue-output => async-io-state

Arguments

collection

A wait-state-collection.

object

A socket-stream or an integer.

read-timeout

nil or a positive real.

write-timeout

nil or a positive real.

user-info

A Lisp object.

udp

nil, t, or the keyword :connected.

ipv6

A boolean.

name

A Lisp object.

queue-output

A boolean.

Values

async-io-state

An async-io-state.

Description

The function create-async-io-state creates an async-io-state for the object object. If object is an integer, then it is assumed to be a socket handle (a file descriptor on Unix-like systems). If object is a socket-stream, then the async-io-state contains its socket.

read-timeout, write-timeout and user-info are set in async-io-state using the corresponding accessors async-io-state-read-timeout, async-io-state-write-timeout and async-io-state-user-info.

If udp is non-nil and object is a socket, then this tells create-async-io-state that the socket is a UDP socket (rather than TCP). If udp is :connected, this also tells create-async-io-state that the socket is a connected socket, which affects whether you can use async-io-state-send-message (connected) or async-io-state-send-message-to-address (unconnected). When object is a stream, it is always assumed to be a TCP socket, regardless of the value of udp. The default value of udp is nil.

ipv6 tells create-async-io-state whether the socket was made as an IPv6 socket (with AF_INET6) or IPv4 (with AF_INET). This makes a difference only for unconnected UDP sockets (it tells async-io-state-send-message-to-address when called with a host name whether to look for IPv6 or IPv4 addresses).

queue-output controls what happens if you try to perform a write operation on the state while another write operation is ongoing. When queue-output is nil this will cause an error. When queue-output is non-nil, the second write operation is queued and actually executed later. The default value of queue-output is nil.

After calling create-async-io-state, object should not be used directly for I/O in the same direction (read or write) until close-async-io-state has been called.

See also

create-async-io-state-and-connected-tcp-socket
accept-tcp-connections-creating-async-io-states
The Async-I/O-State API


LispWorks User Guide and Reference Manual - 20 Sep 2017

NextPrevUpTopContentsIndex