IPX/SPX Programming Manual

Library Routines
HP NonStop IPX/SPX Programming Manual528022-001
5-23
getpeername, getpeername_nw
getpeername,
getpeername_nw
The getpeername and getpeername_nw functions get the IPX address data
structure of the remote host to which the specified socket is connected.
error
is the return value. If the call is successful, a zero is returned. If the call is not
successful, -1 is returned. If the call failed, the external variable errno is set as
indicated below in “Errors.”
socket
specifies the socket number for the socket, as returned by the call to socket or
socket_nw.
address_ptr
points, on return, to the IPX address data structure of the remote socket to which
this socket is connected.
C Synopsis
#include <socket.h>
#include <nv.h>
#include <netdb.h>
error = getpeername (socket, address_ptr, address_len_ptr);
error = getpeername_nw (socket, address_ptr,
address_len_ptr, tag);
int error, socket, *address_len_ptr;
struct sockaddr *address_ptr;
long tag;
TAL Synopsis
?NOLIST, SOURCE SOCKDEFT
?NOLIST, SOURCE SOCKPROC
error := getpeername (socket, address_ptr, address_len_ptr);
error := getpeername_nw (socket, address_ptr,
address_len_ptr, tag);
INT socket,
. EXT address_len_ptr,
.EXT address_ptr (sockaddr);
INT(32) tag: