TCP_ServerAcceptConnection

Short summary

Name

TCP_ServerAcceptConnection

→POU type

→function

Category

more system blocks, network blocks, block with internal error diagnostic

→Namespace

logicals.system.network.tcp

Graphical interface

images/download/attachments/429720027/TCP_ServerAcceptConnection-version-2-modificationdate-1562752564308-api-v2.png

Available since

version 3.2.2 (for library Standard )
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/warning.svg This block is supported for these target systems or platforms:

  • Raspberry Pi, Revolution Pi

  • platform WindowsX86 (incl. the built-in PLC under Windows)

  • platform LinuxX86

Functionality

The block accepts an incoming client connection.

Inputs, outputs, return value


Identifier

→Data type

Description

Inputs:

serverHandle

TCP_ServerHandle

→TCP h andle

Outputs:

address

DWORD

IP address from client

port

UINT

IP port from client

clientHandle

TCP_ClientHandle

handle of the client address and port

Return value:

(= rc )

TCP_ErrorCode

returns the status of the TCP operation:

  • succeeded: The operation is successful.

  • cannotAcceptClientConnection: Too many system resources are reserved.
    Reduce the usage of TCP_ServerAcceptConnection.

  • noInComingConnection: There are no client connections.

Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.

See:

Internal error diagnostic for block

The block checks the following error cases:

  • Too many system resources are reserved.

  • There are no client connections.

In such an error case, the output ENO of the block is set to value FALSE (or an equivalent). Moreover, the block returns the appropriate code (see the above table).

Example for usage within ST-editor

See " TCP_ServerOpen block ".

When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.