![]() |
|
| << Previous | Index | Next >> | |
| | |
int getsockname( sock_type *s, void *dest, int *len );
Description
Gets the controller's IP address and port information for a particular socket.
Parameters
s
- Pointer to the socket.
dest
- Pointer to
sockaddrto hold the socket information for the local 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).BSDNAME.LIBwill assume 14 bytes if aNULLpointer is passed.
Return Value
0: Success.-1: Failure.Library
BSDNAME.LIB
See Also
| TCP/IP Manual Vol 1 |
<<Previous | Index | Next>> | rabbit.com |