00001 #ifndef _client_Connection_
00002 #define _client_Connection_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <map>
00025 #include <string>
00026 #include "Channel.h"
00027 #include "ConnectionImpl.h"
00028 #include "qpid/client/Session.h"
00029 #include "qpid/framing/AMQP_HighestVersion.h"
00030 #include "qpid/framing/Uuid.h"
00031
00032 namespace qpid {
00033
00040 namespace client {
00041
00053 class Connection
00054 {
00055 framing::ChannelId channelIdCounter;
00056 framing::ProtocolVersion version;
00057 const uint32_t max_frame_size;
00058 bool isOpen;
00059 bool debug;
00060
00061 protected:
00062 boost::shared_ptr<ConnectionImpl> impl;
00063
00064 public:
00078 Connection(bool debug = false, uint32_t max_frame_size = 65535,
00079 framing::ProtocolVersion=framing::highestProtocolVersion);
00080 Connection(boost::shared_ptr<Connector>);
00081 ~Connection();
00082
00100 void open(const std::string& host, int port = 5672,
00101 const std::string& uid = "guest",
00102 const std::string& pwd = "guest",
00103 const std::string& virtualhost = "/");
00104
00111 void close();
00112
00123 void openChannel(Channel&);
00124
00137 Session newSession(SynchronousMode sync, uint32_t detachedLifetime=0);
00138
00143 void resume(Session& session);
00144 };
00145
00146 }}
00147
00148
00149 #endif