Ip_Client_Open - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

Keywords & Run-Time Library Functions (Cont.)

IP_CLIENT_OPEN

NetLinx Programming Language Reference Guide
This function opens a port for IP communication with a server.
SLONG IP_CLIENT_OPEN
(INTEGER LocalPort,
CHAR ServerAddress[ ],
LONG ServerPort,
INTEGER Protocol)
Parameters:
• LocalPort: A user-defined (non-zero) integer value representing the local
port on the client machine to use for this conversation. This local port
number must be passed to IP_Client_Close to close the conversation.
• ServerAddress: A string containing either the IP address (in dotted-quad-
notation) or the domain name of the server to connect to.
• ServerPort: The port number on the server that identifies the program or
service the client is requesting.
• Protocol: The transport protocol to use:
1 = TCP
2 = UDP
3 = UDP with Receive
If this parameter is not specified, TCP (1) is assumed. The constants
IP_TCP, IP_UDP and IP_UDP_2WAY can be used to specify this parameter.
Result:
This function always returns 0. Errors are returned via the DATA_EVENT
ONERROR method. The following errors may be returned:
2: General failure (out of memory)
4: Unknown host
6: Connection refused
7: Connection timed out
8: Unknown connection error
14: Local port already used
16: Too many open sockets
17: Local Port Not Open
Example:
IP_CLIENT_OPEN(PORT1, SvAddr, SvPort, IP_TCP)
Seethe IP Communication section on page 189 for more information.
Reserved Identifiers
135

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents