123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- #ifndef UA_CONNECTION_H_
- #define UA_CONNECTION_H_
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include "ua_types.h"
- #include "ua_job.h"
- typedef enum UA_ConnectionState {
- UA_CONNECTION_OPENING,
- UA_CONNECTION_ESTABLISHED,
- UA_CONNECTION_CLOSED,
- } UA_ConnectionState;
- typedef struct UA_ConnectionConfig {
- UA_UInt32 protocolVersion;
- UA_UInt32 sendBufferSize;
- UA_UInt32 recvBufferSize;
- UA_UInt32 maxMessageSize;
- UA_UInt32 maxChunkCount;
- } UA_ConnectionConfig;
- extern const UA_EXPORT UA_ConnectionConfig UA_ConnectionConfig_standard;
- struct UA_SecureChannel;
- typedef struct UA_SecureChannel UA_SecureChannel;
- struct UA_Connection {
- UA_ConnectionState state;
- UA_ConnectionConfig localConf;
- UA_ConnectionConfig remoteConf;
- UA_SecureChannel *channel;
- UA_Int32 sockfd;
-
- void *handle;
- UA_ByteString incompleteMessage;
-
- UA_StatusCode (*getSendBuffer)(UA_Connection *connection, size_t length, UA_ByteString *buf);
-
- void (*releaseSendBuffer)(UA_Connection *connection, UA_ByteString *buf);
-
- UA_StatusCode (*send)(UA_Connection *connection, UA_ByteString *buf);
-
- UA_StatusCode (*recv)(UA_Connection *connection, UA_ByteString *response, UA_UInt32 timeout);
-
- void (*releaseRecvBuffer)(UA_Connection *connection, UA_ByteString *buf);
-
- void (*close)(UA_Connection *connection);
- };
- void UA_EXPORT UA_Connection_init(UA_Connection *connection);
- void UA_EXPORT UA_Connection_deleteMembers(UA_Connection *connection);
- void UA_EXPORT UA_Connection_detachSecureChannel(UA_Connection *connection);
- void UA_EXPORT UA_Connection_attachSecureChannel(UA_Connection *connection, UA_SecureChannel *channel);
- UA_Job UA_EXPORT UA_Connection_completeMessages(UA_Connection *connection, UA_ByteString received);
- #ifdef __cplusplus
- }
- #endif
- #endif
|