Data Fields
UA_Connection Struct Reference

#include <ua_connection.h>

Data Fields

UA_ConnectionState state
UA_ConnectionConfig localConf
UA_ConnectionConfig remoteConf
UA_SecureChannelchannel
UA_Int32 sockfd
 > The securechannel that is attached to this connection (or null)
void * handle
 > Most connectivity solutions run on sockets. Having the socket id here simplifies the design.
UA_ByteString incompleteMessage
 > A pointer to the networklayer
UA_StatusCode(* getBuffer )(UA_Connection *connection, UA_ByteString *buf, size_t minSize)
 > Half-received messages (tcp is a streaming protocol) get stored here
void(* releaseBuffer )(UA_Connection *connection, UA_ByteString *buf)
 > Attach the data array to the buffer. Fails if minSize is larger than remoteConf allows
UA_StatusCode(* write )(UA_Connection *connection, const UA_ByteString *buf)
 > Release the buffer
UA_StatusCode(* recv )(UA_Connection *connection, UA_ByteString *response, UA_UInt32 timeout)
 > The bytestrings cannot be reused after sending!
void(* close )(UA_Connection *connection)

Detailed Description

The connection to a single client (or server). The connection is defined independent of the underlying network layer implementation. This allows a plugging-in custom implementations (e.g. an embedded TCP stack)


Field Documentation

void(* UA_Connection::close)(UA_Connection *connection)
UA_StatusCode(* UA_Connection::getBuffer)(UA_Connection *connection, UA_ByteString *buf, size_t minSize)

> Half-received messages (tcp is a streaming protocol) get stored here

> Most connectivity solutions run on sockets. Having the socket id here simplifies the design.

> A pointer to the networklayer

> The bytestrings cannot be reused after sending!

Receive a message from the remote connection

Parameters:
connectionThe connection
responseThe response string. It is allocated by the connection and needs to be freed with connection->releaseBuffer
timeoutTimeout of the recv operation in milliseconds
Returns:
Returns UA_STATUSCODE_BADCOMMUNICATIONERROR if the recv operation can be repeated, UA_STATUSCODE_GOOD if it succeeded and UA_STATUSCODE_BADCONNECTIONCLOSED if the connection was closed.

> Attach the data array to the buffer. Fails if minSize is larger than remoteConf allows

> The securechannel that is attached to this connection (or null)

> Release the buffer


The documentation for this struct was generated from the following file: