VMS Help
TCPIP Services, Programming Interfaces, Sockets API, getpeername()
*Conan The Librarian (sorry for the slow response - running on an old VAX)
|
|
Returns the name of the connected peer.
The $QIO equivalent is the IO$_SENSEMODE function with the p4
argument.
Format
#include <types.h>
#include <socket.h>
int getpeername ( int s, struct sockaddr *name, int *namelen
);
s
A socket descriptor created using socket().
name
A pointer to a buffer where the peer name is to be returned.
namelen
An address of an integer that specifies the size of the name
buffer. On return, it is modified to reflect the actual length,
in bytes, of the name returned.
This function returns the name of the peer connected to the
specified socket descriptor.
Related Functions
See also bind(), socket(), and getsockname().
0 Successful completion.
-1 Error; errno is set to indicate the error.
EBADF The descriptor is invalid.
EFAULT The name argument is not a valid part of the
user address space.
EINVAL The socket has been shut down.
ENOBUFS The system has insufficient resources to
complete the call.
ENOTCONN The socket is not connected.
ENOTSOCK The socket descriptor is invalid.
EOPNOTSUPP The operation is not supported for the socket
protocol.
[legal]
[privacy]
[GNU]
[policy]
[netiquette]
[sponsors]
[FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.