address family, e.g., @code{AF_INET6}. Similarly,
@var{hint_socktype} should specify the requested socket type
(e.g., @code{SOCK_DGRAM}), and @var{hint_protocol} should
-specify the requested protocol (its value is interpretered
+specify the requested protocol (its value is interpreted
as in calls to @code{socket}).
On error, an exception with key @code{getaddrinfo-error} is
@deffn {Scheme Procedure} sockaddr:fam sa
Return the address family from socket address object @var{sa}. This
-is one of the @code{AF} constants (eg. @code{AF_INET}).
+is one of the @code{AF} constants (e.g.@: @code{AF_INET}).
@end deffn
@deffn {Scheme Procedure} sockaddr:path sa
(@pxref{Network Socket Address}). The return value is unspecified.
Generally a socket is only explicitly bound to a particular address
-when making a server, ie. to listen on a particular port. For an
+when making a server, i.e.@: to listen on a particular port. For an
outgoing connection the system will assign a local address
automatically, if not already bound.
@deffn {Scheme Procedure} getpeername sock
@deffnx {C Function} scm_getpeername (sock)
Return a socket address object which is where @var{sock} is connected
-to, ie. the remote endpoint.
+to, i.e.@: the remote endpoint.
Note that on many systems the address of a socket in the
@code{AF_UNIX} namespace cannot be read.
Receive data from a socket port.
@var{sock} must already
be bound to the address from which data is to be received.
-@var{buf} is a string into which
+@var{buf} is a bytevector into which
the data will be written. The size of @var{buf} limits
the amount of
data which can be received: in the case of packet
@vindex MSG_OOB
@vindex MSG_PEEK
@vindex MSG_DONTROUTE
-Transmit the string @var{message} on a socket port @var{sock}.
+Transmit bytevector @var{message} on socket port @var{sock}.
@var{sock} must already be bound to a destination address. The value
returned is the number of bytes transmitted---it's possible for this
to be less than the length of @var{message} if the socket is set to be
any unflushed buffered port data is ignored.
@end deffn
-@deffn {Scheme Procedure} recvfrom! sock str [flags [start [end]]]
-@deffnx {C Function} scm_recvfrom (sock, str, flags, start, end)
+@deffn {Scheme Procedure} recvfrom! sock buf [flags [start [end]]]
+@deffnx {C Function} scm_recvfrom (sock, buf, flags, start, end)
Receive data from socket port @var{sock}, returning the originating
address as well as the data. This function is usually for datagram
sockets, but can be used on stream-oriented sockets too.
-The data received is stored in the given @var{str}, the whole string
-or just the region between the optional @var{start} and @var{end}
-positions. The size of @var{str} limits the amount of data which can
-be received. For datagram protocols if a packet larger than this is
-received then excess bytes are irrevocably lost.
+The data received is stored in bytevector @var{buf}, using
+either the whole bytevector or just the region between the optional
+@var{start} and @var{end} positions. The size of @var{buf}
+limits the amount of data that can be received. For datagram
+protocols if a packet larger than this is received then excess
+bytes are irrevocably lost.
The return value is a pair. The @code{car} is the number of bytes
read. The @code{cdr} is a socket address object (@pxref{Network
@deffnx {Scheme Procedure} sendto sock message AF_INET6 ipv6addr port [flowinfo [scopeid [flags]]]
@deffnx {Scheme Procedure} sendto sock message AF_UNIX path [flags]
@deffnx {C Function} scm_sendto (sock, message, fam, address, args_and_flags)
-Transmit the string @var{message} as a datagram on socket port
+Transmit bytevector @var{message} as a datagram socket port
@var{sock}. The destination is specified either as a socket address
object, or as arguments the same as would be taken by
@code{make-socket-address} to create such an object (@pxref{Network