| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Determines the port number a socket is connected to.
INetPort( <pSocket> ) --> nPortNumber
The function returns the port number of a connected socket as a numeric value.
Function INetPort() is of informational character. It returns the port number a socket is connected to. The port number must be specified when connecting a socket to a remote station.
| See also: | INetAccept(), INetAddress(), INetConnect(), INetDGram(), INetGetHosts() |
| Category: | Internet functions , Sockets functions , xHarbour extensions |
| Source: | vm\INet.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example displays the internet address of www.xHarbour.com
PROCEDURE Main
LOCAL pSocket
INetInit()
pSocket := INetConnect( "www.xharbour.com", 80 )
? INetPort( pSocket ) // result: 80
INetClose( pSocket )
INetCleanUp()
RETURN
http://www.xHarbour.com