Difference between revisions of "FSOCKOPEN()"

From Lianjapedia
Jump to: navigation, search
m (1 revision)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to open a TCP/IP socket
 
Function to open a TCP/IP socket
 
  
 
==Syntax==
 
==Syntax==
 
FSOCKOPEN(<expC>, <expN>)
 
FSOCKOPEN(<expC>, <expN>)
 
  
 
==See Also==
 
==See Also==
 
[[FCLOSE()]], [[FFLUSH()]], [[FGETS()]], [[FPUTS()]], [[FREAD()]]
 
[[FCLOSE()]], [[FFLUSH()]], [[FGETS()]], [[FPUTS()]], [[FREAD()]]
 
  
 
==Description==
 
==Description==
 
The FSOCKOPEN() function opens a TCP/IP socket.  It returns a numeric pointer when the socket is opened successfully, or a -1 if unsuccessful.  The <expC> is the hostname of the server, <expN> is the port number.  Since the pointer is required to identify an open socket to other functions, always assign the return value to a memory variable.   
 
The FSOCKOPEN() function opens a TCP/IP socket.  It returns a numeric pointer when the socket is opened successfully, or a -1 if unsuccessful.  The <expC> is the hostname of the server, <expN> is the port number.  Since the pointer is required to identify an open socket to other functions, always assign the return value to a memory variable.   
 
  
 
The FCLOSE() function is used to close a socket which has been opened with FSOCKOPEN().
 
The FCLOSE() function is used to close a socket which has been opened with FSOCKOPEN().
 
  
 
==Example==
 
==Example==
Line 27: Line 22:
 
</code>
 
</code>
  
==Products==
 
Recital, Recital Server
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 +
[[Category:Lianja VFP Extensions]]
 +
[[Category:VFP Function Extensions]]

Latest revision as of 06:51, 10 December 2012

Purpose

Function to open a TCP/IP socket

Syntax

FSOCKOPEN(<expC>, <expN>)

See Also

FCLOSE(), FFLUSH(), FGETS(), FPUTS(), FREAD()

Description

The FSOCKOPEN() function opens a TCP/IP socket. It returns a numeric pointer when the socket is opened successfully, or a -1 if unsuccessful. The <expC> is the hostname of the server, <expN> is the port number. Since the pointer is required to identify an open socket to other functions, always assign the return value to a memory variable.

The FCLOSE() function is used to close a socket which has been opened with FSOCKOPEN().

Example

fp=fsockopen("www.server.com",80)
if fp > 0
    ...
endif
fclose(fp)