VARKON Version 1.17D 2003-03-25


 
 

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.
 

Optional parameters

none
 

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.
 

See also

tcp_connect()     tcp_listen()     tcp_close()     tcp_outint()     tcp_inint()     tcp_outvec()     tcp_invec()     tcp_outfloat()     tcp_infloat()     tcp_getremote()    
 

VARKON Homepage Index