xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

INetPort()

Determines the port number a socket is connected to.

Syntax

INetPort( <pSocket> ) --> nPortNumber

Arguments

<pSocket>
This is a pointer to a socket.

Return

The function returns the port number of a connected socket as a numeric value.

Description

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.

Info

See also:INetAccept(), INetAddress(), INetConnect(), INetDGram(), INetGetHosts()
Category: Internet functions , Sockets functions , xHarbour extensions
Source:vm\INet.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe