Multiple Client Connections; Closing A Local Port; Connection-Oriented Notifications - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

IP Communication

Multiple client connections

With connection-oriented I/O (TCP), more than one client could request a connection with the server at
the same time. Support for multiple client connections applies only to connection-oriented I/O, that is,
TCP protocol. Opening multiple ports using UDP as the protocol serves no purpose. In that case, any
additional open commands will fail.
To support concurrent requests, the server must call
connection allowed. For example:
IP_SERVER_OPEN (First_Local_Port, 10510, IP_TCP)
IP_SERVER_OPEN (First_Local_Port, 10510, IP_TCP)
IP_SERVER_OPEN (First_Local_Port, 10510, IP_TCP)
This allows three simultaneous connections on port 10510. Note that each call to
uses a different local port number.

Closing a local port

To close a local port, the server application must call
I/O can be handled using the specified local port. The syntax:
IP_SERVER_CLOSE(LocalPort)
Parameters:

Connection-oriented notifications

The server receives the following notifications when a client connects or disconnects. The protocol in
this case must be TCP.
DATA[0:LocalPort:0]
{
}
Parameters:
192
Protocol: The transport protocol to use (1 = TCP, 2 = UDP). If this parameter is not specified,
TCP (1) is assumed. The constants
parameter.
LocalPort: The local port number to close.
ONLINE:
{
// client has connected
}
OFFLINE:
{
// client has disconnected
}
Device is (or contains as part of an array) the device representing the conversation
(0:LocalPort:0).
and
can be used to specify this
IP_TCP
IP_UDP
once for each simultaneous
IP_SERVER_OPEN
. Once that is called, no
IP_SERVER_CLOSE
NetLinx Programming Language Reference Guide
IP_SERVER_OPEN

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents