![]() |
|
| << Previous | Index | Next >> | |
| | |
int getpeername( sock_type *s, void *dest, int *len );
Description
Gets the peer's IP address and port information for the specified socket.
Parameters
s
- Pointer to the socket.
dest
- Pointer to
sockaddrto hold the socket information for the remote end of the socket. The data structure is:
typedef struct sockaddr {
word s_type; // reserved
word s_port; // port #, or 0 if not connected
longword s_ip; // IP addr, or 0 if not connected
byte s_spares[6]; // not used for tcp/ip connections
};len
- Pointer to the length of
sockaddr. ANULLpointer can be used to represent thesizeof(struct sockaddr).
Return Value
0: Success.-1: Failure.Library
BSDNAME.LIB
See Also
| TCP/IP Manual Vol 1 |
<<Previous | Index | Next>> | rabbit.com |