open62541 1.3.12
Open source implementation of OPC UA
Loading...
Searching...
No Matches
network_tcp.h
Go to the documentation of this file.
1/** This work is licensed under a Creative Commons CCZero 1.0 Universal License.
2 * See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
3 *
4 * Copyright 2016 (c) Fraunhofer IOSB (Author: Julius Pfrommer)
5 * Copyright 2020 (c) HMS Industrial Networks AB (Author: Jonas Green)
6 */
7
8#ifndef UA_NETWORK_TCP_H_
9#define UA_NETWORK_TCP_H_
10
11#include <open62541/client.h>
13#include <open62541/server.h>
14
16
17/** Initializes a TCP network layer.
18 *
19 * @param config The connection config.
20 * @param port The TCP port to listen to.
21 * @param maxConnections Maximum number of TCP connections this network layer
22 * instance is allowed to allocate. Set to 0 for unlimited
23 * number of connections.
24 * @param logger Pointer to a logger
25 * @return Returns the network layer instance */
28 UA_UInt16 maxConnections);
29
30/** Open a non-blocking client TCP socket. The connection might not be fully
31 * opened yet. Drop into the _poll function withe a timeout to complete the
32 * connection. */
35 UA_UInt32 timeout, const UA_Logger *logger);
36
37/** Wait for a half-opened connection to fully open. Returns UA_STATUSCODE_GOOD
38 * even if the timeout was hit. Returns UA_STATUSCODE_BADDISCONNECT if the
39 * connection is lost. */
42 const UA_Logger *logger);
43
45
46#endif /* UA_NETWORK_TCP_H_ */
#define _UA_BEGIN_DECLS
#undef UA_DEBUG_DUMP_PKGS
Definition config.h:89
#define _UA_END_DECLS
Definition config.h:96
UA_StatusCode UA_ClientConnectionTCP_poll(UA_Connection *connection, UA_UInt32 timeout, const UA_Logger *logger)
Wait for a half-opened connection to fully open.
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.
_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.
uint16_t UA_UInt16
Definition types.h:46
uint32_t UA_UInt32
Definition types.h:56
uint32_t UA_StatusCode
Definition types.h:77