| Special Command Tags |
|
| Format | OPEN
(chan[,fileopt])"[TCP][server];socket[;tcp_opts]" Where:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description | The
[TCP] tag is used as a prefix in an OPEN
statement to denote that ProvideX is to open the channel
for a TCP/IP connection. The TCP interface in ProvideX acts like a "smart" two-way communications pipe. A ProvideX TCP connection can be either a Server or Client-style connection; these are explained in the following sections. A single program can have many TCP sockets opened concurrently, with each independent of the others. However, there are operating system limitations. For more information, see System Limits. Omit the server value from the TCP OPEN syntax to notify ProvideX that the channel is to be opened as a host/server.
This opens a TCP channel as a host/server connection with a block size of 8192 bytes. A host/server can communicate with more than one client at a time. (You can override this by using SINGLE as one of your tcp_opts.) Include the optional server, to notify ProvideX that the channel is to be opened as client connection linked to the socket where the host is listening; i.e., this opens a channel to create a link to the host's socket number. A client can only communicate with the specific host to which it is connected.
The example above opens a client link to a TCP channel, port 10000 on the server. The client PC uses any available socket number for its side of the communications. Note that the local machine dynamically assigns an available socket for your program to use. The KEF( ) Function, can be used to identify local sockets; e.g.,
The data in MY_KEY$is in IP format, "10.12.1.12;80;GORDD". As another example, open (1)"[tcp]www.microsoft.com;80;nodelay" opens a connection to Microsoft's website, which is listening to socket number 80 (the default). This also turns off the 200ms delay packet optimization algorithm. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| See Also | OPEN
Directive TCP/IP Access Specifications in the ProvideX User's Guide |
||||||||||||||||||||||||||||||||||||||||||||||||||||||