open62541 1.3.12
Open source implementation of OPC UA
Loading...
Searching...
No Matches
network_tcp.h File Reference

Go to the source code of this file.

Functions

_UA_BEGIN_DECLS UA_ServerNetworkLayer UA_ServerNetworkLayerTCP (UA_ConnectionConfig config, UA_UInt16 port, UA_UInt16 maxConnections)
 
UA_Connection UA_ClientConnectionTCP_init (UA_ConnectionConfig config, const UA_String endpointUrl, UA_UInt32 timeout, const UA_Logger *logger)
 
UA_StatusCode UA_ClientConnectionTCP_poll (UA_Connection *connection, UA_UInt32 timeout, const UA_Logger *logger)
 

Function Documentation

◆ UA_ServerNetworkLayerTCP()

_UA_BEGIN_DECLS UA_ServerNetworkLayer UA_ServerNetworkLayerTCP ( UA_ConnectionConfig config,
UA_UInt16 port,
UA_UInt16 maxConnections )

This work is licensed under a Creative Commons CCZero 1.0 Universal License.

See http://creativecommons.org/publicdomain/zero/1.0/ for more information.

Copyright 2016 (c) Fraunhofer IOSB (Author: Julius Pfrommer) Copyright 2020 (c) HMS Industrial Networks AB (Author: Jonas Green) Initializes a TCP network layer.

Parameters
configThe connection config.
portThe TCP port to listen to.
maxConnectionsMaximum number of TCP connections this network layer instance is allowed to allocate. Set to 0 for unlimited number of connections.
loggerPointer to a logger
Returns
Returns the network layer instance

◆ UA_ClientConnectionTCP_init()

UA_Connection UA_ClientConnectionTCP_init ( UA_ConnectionConfig config,
const UA_String endpointUrl,
UA_UInt32 timeout,
const UA_Logger * logger )

Open a non-blocking client TCP socket.

The connection might not be fully opened yet. Drop into the _poll function withe a timeout to complete the connection.

◆ UA_ClientConnectionTCP_poll()

UA_StatusCode UA_ClientConnectionTCP_poll ( UA_Connection * connection,
UA_UInt32 timeout,
const UA_Logger * logger )

Wait for a half-opened connection to fully open.

Returns UA_STATUSCODE_GOOD even if the timeout was hit. Returns UA_STATUSCODE_BADDISCONNECT if the connection is lost.