|
tcp_getlocal - function
Description
| Get information about local adress and port used for the specified socket connection.
|
Syntax
| tcp_getlocal(socket, adress, port); |
INT |
socket |
STRING |
adress |
INT |
port |
Principal parameters
|
socket |
- id of the socket connection to check. |
adress |
- string to retrieve the local adress used for the specified socket connection (normaly "127.0.0.1"). |
port |
- integer to retrieve the local port number used for the specified socket connection. |
Return value |
An INT value equal to the current error status as below:
|
0 =
|
Operation was successful.
|
-2 =
|
The descriptor is not a socket or the socket is not connected.
|
-3 =
|
The network subsystem or the associated service provider has failed.
|
-25 =
|
Winsock routine getsocket() failed.
|
Examples |
INT status;
INT socket;
STRING adress*20;
INT port;
status := tcp_getlocal(socket,address,port);
We will receive information about our local connection
(port and adress) for the socket connection with id=socket.
|
|
|