updated Makefile, removed vhost from Login object

This commit is contained in:
Emiel Bruijntjes 2014-01-04 05:10:25 -08:00
parent c3dc55eeab
commit c87739312a
4 changed files with 30 additions and 19 deletions

View File

@ -1,14 +1,14 @@
CPP = g++-4.8
RM = rm -f
CPP = g++
RM = rm -f
CPPFLAGS = -Wall -c -I. -O2 -flto -std=c++11 -g
LD = g++
LD = g++
LD_FLAGS = -Wall -shared -O2
RESULT = libcopernica_amqp.so
RESULT = libamqp++.so
STATIC = $(RESULT:%.so=%.a)
SOURCES = $(wildcard *.cpp)
OBJECTS = $(SOURCES:%.cpp=%.o)
OBJECTS_STATIC = $(SOURCES:%.cpp=%.s.o)
OBJECTS_STATIC = $(SOURCES:%.cpp=%.s.o)
all: ${OBJECTS} ${OBJECTS_STATIC} ${RESULT}
$(MAKE) STATIC_LIB

View File

@ -50,7 +50,7 @@ ChannelImpl::ChannelImpl(Channel *parent, Connection *connection, ChannelHandler
_state = state_closed;
// invalid id, this channel can not exist
handler->onChannelError(_parent, "Max number of channels reached");
handler->onError(_parent, "Max number of channels reached");
}
else
{

View File

@ -15,6 +15,29 @@
*/
namespace AMQP {
/**
* Construct an AMQP object based on full login data
*
* The first parameter is a handler object. This handler class is
* an interface that should be implemented by the caller.
*
* Note that the constructor is private to ensure that nobody can construct
* this class, only the real Connection class via a friend construct
*
* @param parent Parent connection object
* @param handler Connection handler
* @param login Login data
*/
ConnectionImpl::ConnectionImpl(Connection *parent, ConnectionHandler *handler, const Login &login, const std::string &vhost) :
_parent(parent), _handler(handler), _login(login), _vhost(vhost)
{
// we need a protocol header
ProtocolHeaderFrame header;
// send out the protocol header
send(header);
}
/**
* Destructor
*/
@ -27,18 +50,6 @@ ConnectionImpl::~ConnectionImpl()
close();
}
/**
* Initialize the connection
*/
void ConnectionImpl::initialize()
{
// we need a protocol header
ProtocolHeaderFrame header;
// send out the protocol header
send(header);
}
/**
* Add a channel to the connection, and return the channel ID that it
* is allowed to use, or 0 when no more ID's are available

View File

@ -33,7 +33,7 @@ bool ConnectionTuneFrame::process(ConnectionImpl *connection)
connection->send(okframe);
// and finally we start to open the frame
ConnectionOpenFrame openframe(connection->login().vhost());
ConnectionOpenFrame openframe(connection->vhost());
// send the open frame
connection->send(openframe);