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

async-io-state-read-buffer Function

Summary

Asynchronously fills a buffer with bytes read from an async-io-state.

Package

comm

Signature

async-io-state-read-buffer async-io-state buffer callback &key start end timeout error-callback user-info

Arguments
async-io-state
buffer
callback
A function designator for a function of 3 arguments.
start
A lower bounding index designator for buffer.
end
An upper bounding index designator for buffer.
timeout
nil or a positive real.
error-callback
A function designator for a function of 3 arguments, or nil.
user-info
A Lisp object.
Description

The function async-io-state-read-buffer asynchronously fills the buffer buffer between start and end with bytes read from async-io-state. When buffer is full (between start and end) or the async-io-state-read-timeout of async-io-state has passed, callback is called like this:

callback async-io-state buffer number-of-bytes-read

If an error occurs during the I/O operation and error-callback is non-nil, then error-callback is called with these same arguments:

error-callback async-io-state buffer number-of-bytes-read

If error-callback is nil, then callback is called, so it should check for errors using async-io-state-read-status.

The default value of start is 0. The default value of end is the length of buffer.

If the operation does not finish within the state's async-io-state-read-timeout period then state's async-io-state-read-status is set to :timeout and callback is called.

If timeout or user-info are supplied then they set async-io-state-read-timeout and async-io-state-user-info in async-io-state for this and subsequent operations.

If another read operation on the state is in progress, an error is signaled.

See also

async-io-state-write-buffer
async-io-state-read-with-checking
25.7.2 The Async-I/O-State API
25 TCP and UDP socket communication and SSL


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:26