Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef UA_CONNECTION_H_
00017 #define UA_CONNECTION_H_
00018
00019 #ifdef __cplusplus
00020 extern "C" {
00021 #endif
00022
00023 #include "ua_types.h"
00024
00031 typedef enum UA_ConnectionState {
00032 UA_CONNECTION_OPENING,
00033 UA_CONNECTION_ESTABLISHED,
00034 UA_CONNECTION_CLOSED,
00035 } UA_ConnectionState;
00036
00037 typedef struct UA_ConnectionConfig {
00038 UA_UInt32 protocolVersion;
00039 UA_UInt32 sendBufferSize;
00040 UA_UInt32 recvBufferSize;
00041 UA_UInt32 maxMessageSize;
00042 UA_UInt32 maxChunkCount;
00043 } UA_ConnectionConfig;
00044
00045 extern const UA_EXPORT UA_ConnectionConfig UA_ConnectionConfig_standard;
00046
00047
00048 struct UA_SecureChannel;
00049 typedef struct UA_SecureChannel UA_SecureChannel;
00050
00051 struct UA_Connection;
00052 typedef struct UA_Connection UA_Connection;
00053
00059 struct UA_Connection {
00060 UA_ConnectionState state;
00061 UA_ConnectionConfig localConf;
00062 UA_ConnectionConfig remoteConf;
00063 UA_SecureChannel *channel;
00064 UA_Int32 sockfd;
00065 void *handle;
00066 UA_ByteString incompleteMessage;
00067 UA_StatusCode (*getBuffer)(UA_Connection *connection, UA_ByteString *buf, size_t minSize);
00068 void (*releaseBuffer)(UA_Connection *connection, UA_ByteString *buf);
00069 UA_StatusCode (*write)(UA_Connection *connection, const UA_ByteString *buf);
00070
00078 UA_StatusCode (*recv)(UA_Connection *connection, UA_ByteString *response, UA_UInt32 timeout);
00079 void (*close)(UA_Connection *connection);
00080 };
00081
00082 void UA_EXPORT UA_Connection_init(UA_Connection *connection);
00083 void UA_EXPORT UA_Connection_deleteMembers(UA_Connection *connection);
00084
00085 void UA_EXPORT UA_Connection_detachSecureChannel(UA_Connection *connection);
00086 void UA_EXPORT UA_Connection_attachSecureChannel(UA_Connection *connection, UA_SecureChannel *channel);
00087
00090 UA_ByteString UA_EXPORT UA_Connection_completeMessages(UA_Connection *connection, UA_ByteString received);
00091
00094 #ifdef __cplusplus
00095 }
00096 #endif
00097
00098 #endif