xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

INetConnectIP()

Establishes a sockets connection to a server using the IP address.

Syntax

INetConnectIP( <cIPAddress>, <nPort> ) --> pSocket

or

INetConnectIP( <cIPAddress>, <nPort>, <pSocket> ) --> NIL

Arguments

<cIPAddress>
This is a character string holding IP address of the server in dotted notation (e.g. "192.168.1.145").
<nPort>
This is the numeric port number on the local computer to use for the socket connection. The default internet port is 80.
<pSocket>
Optionally, a socket created with INetCreate() or previously closed with INetClose() can be passed to establish a connection.

Return

If called with two parameters, the return value is a pointer to a socket. If a socket is passed as third parameter, the return value is NIL.

Description

INetConnectIP() does the same as INetConnect() except for not resolving the IP address from the server's URL, or DNS name. INetConnectIP() accepts only the IP address of the server in dottet notation. Therefore, the function is thread safe and can be called simultaneously in multiple threads.

If the connection is successfully established, the socket can be used for sending and receiving data to/from the server. If the connection fails, the cause of failure can be detected with INetErrorCode().

Info

See also:INetAccept(), INetCreate(), INetConnect(), INetDGram(), INetInit(), INetRecv(), INetSend()
Category: Internet functions , Sockets functions , xHarbour extensions
Source:vm\inet.c
LIB:xhb.lib
DLL:xhbdll.dll


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