TCP/IP Programming Manual

error = socket_get_info(socket, sockaddr_buffer, buflen);
int error, socket;
char *sockaddr_buffer;
int buflen;
TAL Synopsis
?NOLIST, SOURCE SOCKDEFT
?NOLIST, SOURCE SOCKPROC
error := socket_get_info(socket, sockaddr_buffer, buflen);
INT(32) error, socket;
STRING .EXT sockaddr_buffer;
INT(32) buflen;
error
return value; if the call is successful, the size of the sockaddr data structure is returned. If the
call is not successful, –1 is returned. If the call failed, the external variable errno is set as
indicated in Errors (page 195).
socket
input value; the socket specified in the prior recvfrom_nw call.
sockaddr_buffer
input and return value; a character pointer to the sockaddr_in or sockaddr_nv data
structure returned by the call.
buflen
input value; the size of sockaddr_in_buffer or sockaddr_nv_buffer in bytes. Maximum
value is 80 bytes.
Examples
See Examples (page 163) for recvfrom_nw.
Errors
If an error occurs, the variable error is set to one of the following values:
The message was too large to be sent atomically, as required by the socket options.EMSGSIZE
The specified socket was not connected.ENOTCONN
The specified socket was shut down.ESHUTDOWN
An invalid argument was specified.EINVAL
Usage Guideline
Use socket_get_info to retrieve the sockaddr_in or sockaddr_nv data structure and the
length of the sockaddr_in_buffer or sockaddr_nv_buffer, after a call to recvfrom_nw
and AWAITIOX and before a subsequent AWAITIOX call.
socket_get_len
The socket_get_len function returns the number of bytes sent following a sendto_nw or
send_nw2 call.
C Synopsis
#include <socket.h>
#include <in.h>
#include <in6.h> /* for IPv6 use */
socket_get_len 195