13.2 General Sockets
— Class: sb-bsd-sockets:socket
Class precedence list:
socket, standard-object, t
protocol — initargs:
Protocol used by the socket. If a
keyword, the symbol-name of the keyword will be passed to
get-protocol-by-name downcased, and the returned value used as
protocol. Other values are used as-is.
type — initargs:
Type of the socket:
Common base class of all sockets, not ment to be
— Generic Function: sb-bsd-sockets:socket-bind socket &rest address
address, which may vary according to
socket family. For the
inet family, pass
port as two
file address family sockets, pass the filename string.
See also bind(2)
— Generic Function: sb-bsd-sockets:socket-accept socket
Perform the accept(2) call, returning a
newly-created connected socket and the peer address as multiple
— Generic Function: sb-bsd-sockets:socket-connect socket &rest peer
Perform the connect(2) call to connect
socket to a
peer. No useful return value.
— Generic Function: sb-bsd-sockets:socket-peername socket
Return the socket's peer; depending on the address
family this may return multiple values
— Generic Function: sb-bsd-sockets:socket-name socket
Return the address (as vector of bytes) and port
that the socket is bound to, as multiple values.
— Generic Function: sb-bsd-sockets:socket-receive socket buffer length &key oob peek waitall element-type
length octets from
buffer (or a freshly-consed buffer if
NIL), using recvfrom(2). If
nil, the length of
used, so at least one of these two arguments must be non-NIL. If
buffer is supplied, it had better be of an element type one octet wide.
Returns the buffer, its length, and the address of the peer
that sent it, as multiple values. On datagram sockets, sets MSG_TRUNC
so that the actual packet length is returned even if the buffer was too
— Generic Function: sb-bsd-sockets:socket-send socket buffer length &key address external-format oob eor dontroute dontwait nosignal confirm more
length octets from
socket, using sendto(2). If
is a string, it will converted to octets according to
nil, the length of the octet buffer is used. The format of
depends on the socket type (for example for
inet domain sockets it would
be a list of an
ip address and a port). If no socket address is provided,
send(2) will be called instead. Returns the number of octets written.
— Generic Function: sb-bsd-sockets:socket-listen socket backlog
socket as willing to accept incoming connections.
defines the maximum length that the queue of pending connections may
grow to before new connection attempts are refused. See also listen(2)
— Generic Function: sb-bsd-sockets:socket-open-p socket
Return true if
socket is open; otherwise, return false.
— Generic Function: sb-bsd-sockets:socket-close socket
socket. May throw any kind of error that
write(2) would have thrown. If
socket-make-stream has been called,
close on that stream instead
— Generic Function: sb-bsd-sockets:socket-make-stream socket &rest args
Find or create a
stream that can be used for
socket (which must be connected).
args are passed onto
— Function: sb-bsd-sockets:socket-error where
— Generic Function: sb-bsd-sockets:non-blocking-mode socket
socket in non-blocking mode?