sockListen (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

1.00 / 1.00.00


Initiates a TCP/IP socket listen operation on the specified port number. The establishing of the connection must be determined by using the sockConnection() function block.

It is possible to establish a maximum of 8 simultaneous socket connections.

 

It must be observed that typically the GSM-network utilizes a firewall that blocks inbound connections to the RTCU.

 

 

Input:

ip : DINT

Remote IP address accepted. 0 if all is allowed.

 

port : DINT

Port number listening on.

 

iface : SINT (default 0)

The network interface to listen on. 0 = all networks (default), 1 = Mobile network, 2 = LAN network, etc. (See Network)

 

Returns: SINT

ID of the connection. If return value is 0, the connection could not be initiated (possibly because there are too many sockListen() without corresponding sockDisconnect()).

 

 

Declaration:

FUNCTION sockListen : SINT;
VAR_INPUT
  ip   : DINT;       // Accept from this remote IP only. 0=all.
  port : DINT;       // Port number to listen on
  iface : SINT := 0; // Interface to listen on
END_VAR;

 

 


Example:

 

Please see the "Examples - Telnet server"