#include <ua_connection.h>
Data Fields | |
UA_ConnectionState | state |
UA_ConnectionConfig | localConf |
UA_ConnectionConfig | remoteConf |
UA_SecureChannel * | channel |
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) |
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)
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
void* UA_Connection::handle |
> Most connectivity solutions run on sockets. Having the socket id here simplifies the design.
> A pointer to the networklayer
UA_StatusCode(* UA_Connection::recv)(UA_Connection *connection, UA_ByteString *response, UA_UInt32 timeout) |
> The bytestrings cannot be reused after sending!
Receive a message from the remote connection
connection | The connection |
response | The response string. It is allocated by the connection and needs to be freed with connection->releaseBuffer |
timeout | Timeout of the recv operation in milliseconds |
void(* UA_Connection::releaseBuffer)(UA_Connection *connection, UA_ByteString *buf) |
> 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)
UA_StatusCode(* UA_Connection::write)(UA_Connection *connection, const UA_ByteString *buf) |
> Release the buffer