Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
Describe IOLib here.
Describe networking here.
Class precedence list:
socket, dual-channel-single-fd-mixin, dual-channel-fd-mixin, standard-object, tBase class for sockets.
Class precedence list:
stream-socket, socket, dual-channel-single-fd-mixin, dual-channel-fd-mixin, standard-object, tMixin for sockets of type SOCK_STREAM.
Class precedence list:
datagram-socket, socket, dual-channel-single-fd-mixin, dual-channel-fd-mixin, standard-object, tMixin for sockets of type SOCK_DGRAM.
Class precedence list:
internet-socket, socket, dual-channel-single-fd-mixin, dual-channel-fd-mixin, standard-object, tMixin for sockets of domain AF_INET or AF_INET6.
Class precedence list:
local-socket, socket, dual-channel-single-fd-mixin, dual-channel-fd-mixin, standard-object, tMixin for sockets of domain AF_LOCAL.
Class precedence list:
active-socket, socket, dual-channel-single-fd-mixin, dual-channel-gray-stream, trivial-gray-stream-mixin, dual-channel-fd-mixin, fundamental-binary-input-stream, fundamental-binary-output-stream, fundamental-character-input-stream, fundamental-input-stream, fundamental-character-output-stream, fundamental-output-stream, fundamental-character-stream, fundamental-binary-stream, fundamental-stream, standard-object, stream, tMixin class for active(client) sockets.
Class precedence list:
passive-socket, socket, dual-channel-single-fd-mixin, dual-channel-fd-mixin, standard-object, tMixin class for PASSIVE(server) sockets.
Class precedence list:
socket-stream-internet-active, active-socket, stream-socket, internet-socket, socket, dual-channel-single-fd-mixin, dual-channel-gray-stream, trivial-gray-stream-mixin, dual-channel-fd-mixin, fundamental-binary-input-stream, fundamental-binary-output-stream, fundamental-character-input-stream, fundamental-input-stream, fundamental-character-output-stream, fundamental-output-stream, fundamental-character-stream, fundamental-binary-stream, fundamental-stream, standard-object, stream, tClass representing active sockets of type SOCK_STREAM and domain AF_INET or AF_INET6.
Class precedence list:
socket-stream-internet-passive, passive-socket, stream-socket, internet-socket, socket, dual-channel-single-fd-mixin, dual-channel-fd-mixin, standard-object, tClass representing passive sockets of type SOCK_STREAM and domain AF_INET or AF_INET6.
Class precedence list:
socket-stream-local-active, active-socket, stream-socket, local-socket, socket, dual-channel-single-fd-mixin, dual-channel-gray-stream, trivial-gray-stream-mixin, dual-channel-fd-mixin, fundamental-binary-input-stream, fundamental-binary-output-stream, fundamental-character-input-stream, fundamental-input-stream, fundamental-character-output-stream, fundamental-output-stream, fundamental-character-stream, fundamental-binary-stream, fundamental-stream, standard-object, stream, tClass representing active sockets of type SOCK_STREAM and domain AF_LOCAL.
Class precedence list:
socket-stream-local-passive, passive-socket, stream-socket, local-socket, socket, dual-channel-single-fd-mixin, dual-channel-fd-mixin, standard-object, tClass representing passive sockets of type SOCK_STREAM and domain AF_LOCAL.
Class precedence list:
socket-datagram-internet-active, active-socket, datagram-socket, internet-socket, socket, dual-channel-single-fd-mixin, dual-channel-gray-stream, trivial-gray-stream-mixin, dual-channel-fd-mixin, fundamental-binary-input-stream, fundamental-binary-output-stream, fundamental-character-input-stream, fundamental-input-stream, fundamental-character-output-stream, fundamental-output-stream, fundamental-character-stream, fundamental-binary-stream, fundamental-stream, standard-object, stream, tClass representing active sockets of type SOCK_DGRAM and domain AF_INET or AF_INET6.
Class precedence list:
socket-datagram-local-active, active-socket, datagram-socket, local-socket, socket, dual-channel-single-fd-mixin, dual-channel-gray-stream, trivial-gray-stream-mixin, dual-channel-fd-mixin, fundamental-binary-input-stream, fundamental-binary-output-stream, fundamental-character-input-stream, fundamental-input-stream, fundamental-character-output-stream, fundamental-output-stream, fundamental-character-stream, fundamental-binary-stream, fundamental-stream, standard-object, stream, tClass representing active sockets of type SOCK_DGRAM and domain AF_LOCAL.
Create an instance of a subclass of
socket.address-family,type,connectand IPV6 are used to specify the kind of socket to create.To initialize the socket, the following keyword arguments can be used depending on
address-family-:internetor:local(or:fileas synonim)type-:streamor:datagramconnect-:activeor:passive- IPV6
-ifnil, create an IPv4 socket, otherwise an IPv6 socket.address-family,typeandconnect:Glossary:
- :local-host
-a hostname designator ornil. If non-null the socket will be bound to this address- :local-port
-a port designator ornil. Iflocal-hostis non-null, bind the socket to this port. Ifnil, choose a random port- :remote-host
-a hostname designator ornil. If non-null the socket will be connected to this address- :remote-port
-a port designator. Ifremote-hostis non-null, connect the socket to this port- :local-filename
-a string ornil. If non-null the socket will be bound to this file- :remote-filename
-a string ornil. If non-null the socket will be connected to this file- :backlog
-a positive integer ornil. Specifies the length of the incomming connection queue and can't be larger than+max-backlog-size+. Ifnil, default is*default-backlog-size*- :reuse-address: a boolean(default T). set option SO_REUSEADDR if
local-hostis non-null- :keepalive
-a boolean. set option SO_KEEPALIVE- :nodelay
-a boolean. set option SO_NODELAY- :interface
-a string. set option SO_BINDTODEVICE to this interface- :input-buffer-size
-a positive integer. Create the stream input buffer of this size- :output-buffer-size
-a positive integer. Create the stream output buffer of this size:address-family
- hostname designator: an instance of
inet-addressor any object accepted bylookup-host. IPV6 is passed tolookup-hostas is- port designator: any object accepted by
lookup-service:internet:type:stream:connect:active:address-family
- Valid keyword args:
:local-host,:local-port,:remote-host,:remote-port,:reuse-address,:keepalive,:nodelay,:input-buffer-sizeand:output-buffer-size:internet:type:stream:connect:passive:address-family
- Valid keyword args:
:local-host,:local-port,:backlog,:reuse-address,:interfaceand:nodelay:internet:type:stream:connect:active:address-family
- Valid keyword args:
:local-filename,:remote-filename,:input-buffer-sizeand:output-buffer-size:internet:type:stream:connect:passive:address-family
- Valid keyword args:
:local-filename,:remote-filename,:backlogand:reuse-address:internet:type:datagram:address-family
- Valid keyword args:
:local-host,:local-port,:remote-host,:remote-port,:reuse-address,:interfaceand:broadcast:local:type:datagram
- Valid keyword args:
:local-filenameand:remote-filename
Bind
varto a socket created by passingargstomake-socketand executebodyas implicitprogn. The socket is automatically closed upon exit.
Create a socket instance of the appropriate subclass of
socketusingfd. The connection type of the socket must be specified-:activeor:passive. The address family and type of the socket are automatically discovered usingosfunctions. Buffer sizes for the new socket can also be specified usinginput-buffer-sizeandoutput-buffer-size.
Create a pair of sockets connected to each other. The socket type must be either
:streamor:datagram. Currently OSes can only create:localsockets this way. Buffer sizes for the new sockets can also be specified usinginput-buffer-sizeandoutput-buffer-size.
Send the contents of
buffertosocket.buffermust be a vector that can be coerced to a (SIMPLE-ARRAY (UNSIGNED-BYTE 8) (*)).startandendare used a bounding index onbuffer. For disconnected datagram sockets,remote-hostandremote-portorremote-filenameare used as destination for the data.Some flags can also be passed to sendto(2):
Returns the number of bytes sent.
:out-of-bandfor receiving out-of-band data-only for stream sockets:dont-waitfor making only the current call non-blocking:dont-routefor sending only to hosts on directly connected networks, not using gateways:confirmfor signalling progress on the link layer-only available on Linux and only withdatagramsockets:morefor telling the kernel that there is more data to send-only available on Linux
Receives data from
socket. Ifbufferis specifiedstartandendare used as bounding index. In that casebuffermust be an array and itsarray-element-typebe either (UNSIGNED-BYTE 8) ort. Ifbufferis not specified an (UNSIGNED-BYTE 8) buffer of sizesizewill be allocated.Some flags can also be passed to recvfrom(2):
The first two values returned are the buffer and the number of elements that have been copied into the buffer. For
:out-of-bandfor receiving out-of-band data-only forstreamsockets:peekfor keeping the returned data in the kernel buffers:wait-allfor waiting until the entire buffer can be filled:dont-waitfor making only the current call non-blockinginternetdatagramsockets, two additional values are returned: the host and port of the remote peer from which the data was received. Forlocaldatagramsockets, one additional values is returned: the filename of the remote peer from which the data was received.
Sets the local address of
socketto ADDRESS(andportforinternetsockets).reuse-addresssets the SO_REUSEADDR socket option onsocket.
Start allowing incoming connections on
socket.backlogspecifies the maximum length of the queue of pending connections.
Returns one connection from the queue of pending connections on
socket. Ifwaitis true, waits until a connection is received ortimeoutexpires in which case returnsnil. Ifwaitis false and there are no pending connections returnnil.external-formatoptionally specifies the external format of the new socket-the default being that ofsocket. Buffer sizes for the new socket can also be specified usinginput-buffer-sizeandoutput-buffer-size.
Bind
varto a socket created by passingpassive-socketandargstoaccept-connectionand executebodyas implicitprogn. The socket is automatically closed upon exit.
Connects
sockettoaddress. Forinternetsockets you can specify the port to connect to using keyword argumentport. The default value ofportis 0, which usually means letting theoschoose a random port to connect to. Forinternetsockets, ifwaitis true and a connection cannot be established withintimeoutseconds signaliomux:poll-timeout, but it works only with non-blocking sockets.
Disassociates
socketfrom any remote address. Works only ondatagramsockets.
Shut down all or part of a connection. If
readit non-NIL, further receptions are disallowed; ifwriteis non-NIL, further transmissions are disallowed.closemust still be called onsocketin order to releaseosresources.
Send
file-descriptorthroughsocket. The receiving process must usereceive-file-descriptorto receive the file descriptor in order for it to be valid in the receiving process.
For
internetsockets, returns two values: the local host and the local port. Forlocalsockets, returns the local filename.
Returns the local host of
socket. Works only oninternetsockets.
Returns the local port of
socket-an (UNSIGNED-BYTE 16). Works only oninternetsockets.
Returns the local filename of
socket. Works only onlocalsockets.
For
internetsockets, returns two values: the remote host and the remote port. Forremotesockets, returns the remote filename.
Returns the remote host of
socket. Works only oninternetsockets.
Returns the remote port of
socket-an (UNSIGNED-BYTE 16). Works only oninternetsockets.
Returns the remote filename of
socket. Works only onlocalsockets.
Returns a boolean indicating whether or not the file descriptor of
socketis open.
Returns a boolean specifying whether or not
socketis connected.
Class precedence list:
address, standard-object, tBase class for all socket address classes.
Class precedence list:
inet-address, address, standard-object, tBase class for IPv4 and IPv6 addresses.
Class precedence list:
ipv4-address, inet-address, address, standard-object, tIPv4 address. Its low-level representation can be accessed as vector of type IPV4-ARRAY through the
address-namereader.
Class precedence list:
ipv6-address, inet-address, address, standard-object, tIPv6 address. Its low-level representation can be accessed as vector of type IPV6-ARRAY through the
address-namereader.
Class precedence list:
local-address, address, standard-object, t
unixsocket address.
Constructs an
addressobject.nameshould be of type IPV4-ARRAY, IPV6-ARRAY orstringin which case an instance of IPV4-ADDRESS, IPV6-ADDRESS orlocal-address, respectively, will be created. Otherwise, atype-erroris signalled. See alsoensure-address.
Returns a copy of
addresswhich is ADDRESS= to the original.
If
familyis:local, alocal-addressis instantiated withaddressas itsnameslot. Iffamilyis:internet, an appropriate subtype ofinet-addressis instantiated after guessing the address type throughaddress-to-vector. If the address is invalid anderrorpis notnil, then acl:parse-erroris signalled, otherwisenilis returned.When
addressis already an instance of theaddressclass, a check is made to see if it matches thefamilyargument and it is returned unmodified.
Convert any representation of an internet address to a vector. Allowed inputs are: unsigned 32-bit integers, strings, vectors and
inet-addressobjects. If the address is valid, two values are returned: the vector and the address type (:IPV4 or IPV6), otherwisenilis returned.
Returns
tifaddressis an object of classaddress. Does not returntfor other low-level address representations.
Returns
tif both arguments are designators for the same socket address.
Return
tifaddressis alocal-addressthat lives in the abstract namespace.
Returns a keyword symbol denoting the kind of
address(:IPV4, :IPV6 or :LOCAL). Ifaddressis not a known address object,nilis returned.
Returns the address type of
addressas 2 values:For unicast or multicast IPv6 addresses, a third value is returned which corresponds to the return value of IPV6-UNICAST-TYPE or IPV6-MULTICAST-TYPE, respectively.
- protocol, one of :IPV4 or :IPV6
- kind, one of
:unspecified,:loopback,:multicastor:unicast
Returns
tifaddressis a admin-local multicast IPv6 address.
Returns
tifaddressis an IPv6 address representing an IPv4 mapped address.
Returns the multicast type of
addressornilif it's not a multicast address.
Returns
tifaddressis an organization-local multicast IPv6 address.
Returns
tifaddressis an site-local multicast IPv6 address.
Returns
tifaddressis a solicited-node multicast IPv6 address.
Returns
tifaddressis an unassigned multicast IPv6 address.
Returns the unicast type of
addressornilif it's not a unicast address.
Create a subnet mask by specifying either its class(:A,
:bor :C) or acidrsuffix(a number between 0 and 32).
If
thingis of type IPV4-ADDRESS it is returned as is; if keyword it must be one of:a,:bor:cotherwise it's treated as acidrsuffix.
Apply network netmask
netmasktoaddressin order to calculate the network part ofaddress.
Apply network netmask
netmasktoaddressin order to calculate the host part ofaddress.
Return
tifaddressis part of the subnet specified bynetwork.
Return
tif ADDRESS1 and ADDRESS2 are both part part of the subnet specified bynetwork.
Return the network class of
address:one of:a,:b,:c,:dor:e.
Returns
tifaddressis in a private network range. Private IPv4 networks are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. See http://en.wikipedia.org/wiki/Private_network for details.
Convert an (UNSIGNED-BYTE 32) IPv4 address to a dotted string.
Convert a dotted IPv4 address to a (SIMPLE-ARRAY (UNSIGNED-BYTE 8) 4).
Convert a colon-separated IPv6 address to a (SIMPLE-ARRAY (UNSIGNED-BYTE 16) 8).
Convert an (SIMPLE-ARRAY (UNSIGNED-BYTE 16) 8) to a colon-separated IPv6 address.
casemay be:downcaseor:upcase.
Convert a string address (dotted or colon-separated) to a vector address. If the string is not a valid address, return
nil.
Extracts the IPv4 part of an IPv6-mapped IPv4 address. Signals an error if
addressis not an IPv6-mapped IPv4 address.
Looks up a host by name or address. IPV6 determines the IPv6 behaviour, defaults to *IPV6*. Returns 4 values:
- an address
- a list of additional addresses(if existent)
- the canonical name of the host
- an alist of all the host's names with their respective addresses
If
addressis an inet-address designator, it is converted, if necessary, to aninet-addressobject and returned. Otherwise it is assumed to be a host name which is then looked up in order to return its primary address as the first return value and the remaining address list as the second return value.
Class precedence list:
resolver-error, condition, tSignaled when an error occurs while trying to resolve an address.
Return the datum that caused the signalling of a
resolver-errorcondition.
Class precedence list:
resolver-again-error, resolver-error, condition, tCondition signaled when a temporary failure occurred.
Class precedence list:
resolver-fail-error, resolver-error, condition, tCondition signaled when a non-recoverable error occurred.
Class precedence list:
resolver-no-name-error, resolver-error, condition, tCondition signaled when a host or service was not found.
Class precedence list:
resolver-unknown-error, resolver-error, condition, tCondition signaled when an unknown error is signaled while resolving an address.
Lookup a service by port or name.
protocolshould be one of:tcp,:udpor:any.
Class precedence list:
unknown-service, condition, tCondition raised when a network service is not found.
Return the datum that caused the signalling of an
unknown-servicecondition.
Lookup a protocol by name or number. Signals an
unknown-protocolerror if no protocol is found.
Class precedence list:
unknown-protocol, condition, tCondition raised when a network protocol is not found.
Return the datum that caused the signalling of an
unknown-protocolcondition.
Lookup an interface by name or index.
unknown-interfaceis signalled if an interface is not found.
Class precedence list:
unknown-interface, enxio, syscall-error, iolib-error, error, serious-condition, iolib-condition, condition, tCondition raised when a network interface is not found.
Return the datum that caused the signalling of an
unknown-interfacecondition.
sockets:abstract-address-p: Address Predicatessockets:accept-connection: Socket Operatorssockets:active-socket: Socket Classessockets:address: Address Classessockets:address-equal-p: Address Predicatessockets:address-to-string: Address Functionssockets:address-to-vector: Address Functionssockets:address-type: Address Predicatessockets:address=: Address Predicatessockets:addressp: Address Predicatessockets:bind-address: Socket Operatorssockets:colon-separated-to-vector: Low-level Address Manipulationsockets:connect: Socket Operatorssockets:copy-address: Address Functionssockets:datagram-socket: Socket Classessockets:disconnect: Socket Operatorssockets:dotted-to-integer: Low-level Address Manipulationsockets:dotted-to-vector: Low-level Address Manipulationsockets:ensure-address: Address Functionssockets:ensure-hostname: DNSsockets:ensure-netmask: Address Arithmeticsockets:inet-address: Address Classessockets:inet-address-host-portion: Address Arithmeticsockets:inet-address-in-network-p: Address Arithmeticsockets:inet-address-loopback-p: Address Predicatessockets:inet-address-multicast-p: Address Predicatessockets:inet-address-network-class: Address Arithmeticsockets:inet-address-network-portion: Address Arithmeticsockets:inet-address-private-p: Address Arithmeticsockets:inet-address-type: Address Predicatessockets:inet-address-unicast-p: Address Predicatessockets:inet-address-unspecified-p: Address Predicatessockets:inet-addresses-in-same-network-p: Address Arithmeticsockets:integer-to-dotted: Low-level Address Manipulationsockets:integer-to-vector: Low-level Address Manipulationsockets:interface-index: Network Interfacessockets:interface-name: Network Interfacessockets:internet-socket: Socket Classessockets:ipv4-address: Address Classessockets:ipv4-address-p: Address Predicatessockets:ipv6-address: Address Classessockets:ipv6-address-p: Address Predicatessockets:ipv6-admin-local-multicast-p: Address Predicatessockets:ipv6-global-multicast-p: Address Predicatessockets:ipv6-global-unicast-p: Address Predicatessockets:ipv6-interface-local-multicast-p: Address Predicatessockets:ipv6-ipv4-mapped-p: Address Predicatessockets:ipv6-link-local-multicast-p: Address Predicatessockets:ipv6-link-local-unicast-p: Address Predicatessockets:ipv6-multicast-type: Address Predicatessockets:ipv6-organization-local-multicast-p: Address Predicatessockets:ipv6-reserved-multicast-p: Address Predicatessockets:ipv6-site-local-multicast-p: Address Predicatessockets:ipv6-site-local-unicast-p: Address Predicatessockets:ipv6-solicited-node-multicast-p: Address Predicatessockets:ipv6-transient-multicast-p: Address Predicatessockets:ipv6-unassigned-multicast-p: Address Predicatessockets:ipv6-unicast-type: Address Predicatessockets:list-network-interfaces: Network Interfacessockets:listen-on: Socket Operatorssockets:local-address: Address Classessockets:local-address-p: Address Predicatessockets:local-filename: Socket Accessorssockets:local-host: Socket Accessorssockets:local-name: Socket Accessorssockets:local-port: Socket Accessorssockets:local-socket: Socket Classessockets:lookup-hostname: DNSsockets:lookup-interface: Network Interfacessockets:lookup-protocol: Protocolssockets:lookup-service: Servicessockets:make-address: Address Functionssockets:make-interface: Network Interfacessockets:make-netmask: Address Arithmeticsockets:make-socket: Socket Operatorssockets:make-socket-from-fd: Socket Operatorssockets:make-socket-pair: Socket Operatorssockets:map-ipv4-address-to-ipv6: Low-level Address Manipulationsockets:map-ipv6-address-to-ipv4: Low-level Address Manipulationsockets:passive-socket: Socket Classessockets:receive-file-descriptor: Socket Operatorssockets:receive-from: Socket Operatorssockets:remote-filename: Socket Accessorssockets:remote-host: Socket Accessorssockets:remote-name: Socket Accessorssockets:remote-port: Socket Accessorssockets:resolver-again-error: DNSsockets:resolver-error: DNSsockets:resolver-error-datum: DNSsockets:resolver-fail-error: DNSsockets:resolver-no-name-error: DNSsockets:resolver-unknown-error: DNSsockets:send-file-descriptor: Socket Operatorssockets:send-to: Socket Operatorssockets:shutdown: Socket Operatorssockets:socket: Socket Classessockets:socket-address-family: Socket Accessorssockets:socket-connected-p: Socket Predicatessockets:socket-datagram-internet-active: Socket Classessockets:socket-datagram-local-active: Socket Classessockets:socket-ipv6-p: Socket Predicatessockets:socket-open-p: Socket Predicatessockets:socket-os-fd: Socket Accessorssockets:socket-protocol: Socket Accessorssockets:socket-stream-internet-active: Socket Classessockets:socket-stream-internet-passive: Socket Classessockets:socket-stream-local-active: Socket Classessockets:socket-stream-local-passive: Socket Classessockets:socket-type: Socket Accessorssockets:stream-socket: Socket Classessockets:string-address-to-vector: Low-level Address Manipulationsockets:unknown-interface: Network Interfacessockets:unknown-interface-datum: Network Interfacessockets:unknown-protocol: Protocolssockets:unknown-protocol-datum: Protocolssockets:unknown-service: Servicessockets:unknown-service-datum: Servicessockets:vector-to-colon-separated: Low-level Address Manipulationsockets:vector-to-dotted: Low-level Address Manipulationsockets:vector-to-integer: Low-level Address Manipulationsockets:with-accept-connection: Socket Operatorssockets:with-open-socket: Socket Operators