diff --git a/examples/libev.cpp b/examples/libev.cpp index e4c428d..5893ca4 100644 --- a/examples/libev.cpp +++ b/examples/libev.cpp @@ -65,8 +65,9 @@ int main() MyHandler handler(loop); // make a connection - AMQP::TcpConnection connection(&handler, AMQP::Address("amqp://guest:guest@localhost/")); - + AMQP::Address address("amqps://guest:guest@localhost/"); + AMQP::TcpConnection connection(&handler, address); + // we need a channel too AMQP::TcpChannel channel(&connection); diff --git a/include/amqpcpp/address.h b/include/amqpcpp/address.h index 65e17b6..951d3a2 100644 --- a/include/amqpcpp/address.h +++ b/include/amqpcpp/address.h @@ -73,7 +73,7 @@ public: else throw std::runtime_error("AMQP address should start with \"amqp://\" or \"amqps://\""); // begin of the string was parsed - data += 7; + data += _authmethod.length(); // do we have a '@' to split user-data and hostname? const char *at = (const char *)memchr(data, '@', last - data);