updated Makefile, removed vhost from Login object
This commit is contained in:
parent
c3dc55eeab
commit
c87739312a
10
src/Makefile
10
src/Makefile
|
|
@ -1,14 +1,14 @@
|
||||||
CPP = g++-4.8
|
CPP = g++
|
||||||
RM = rm -f
|
RM = rm -f
|
||||||
CPPFLAGS = -Wall -c -I. -O2 -flto -std=c++11 -g
|
CPPFLAGS = -Wall -c -I. -O2 -flto -std=c++11 -g
|
||||||
LD = g++
|
LD = g++
|
||||||
LD_FLAGS = -Wall -shared -O2
|
LD_FLAGS = -Wall -shared -O2
|
||||||
RESULT = libcopernica_amqp.so
|
RESULT = libamqp++.so
|
||||||
|
|
||||||
STATIC = $(RESULT:%.so=%.a)
|
STATIC = $(RESULT:%.so=%.a)
|
||||||
SOURCES = $(wildcard *.cpp)
|
SOURCES = $(wildcard *.cpp)
|
||||||
OBJECTS = $(SOURCES:%.cpp=%.o)
|
OBJECTS = $(SOURCES:%.cpp=%.o)
|
||||||
OBJECTS_STATIC = $(SOURCES:%.cpp=%.s.o)
|
OBJECTS_STATIC = $(SOURCES:%.cpp=%.s.o)
|
||||||
|
|
||||||
all: ${OBJECTS} ${OBJECTS_STATIC} ${RESULT}
|
all: ${OBJECTS} ${OBJECTS_STATIC} ${RESULT}
|
||||||
$(MAKE) STATIC_LIB
|
$(MAKE) STATIC_LIB
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ ChannelImpl::ChannelImpl(Channel *parent, Connection *connection, ChannelHandler
|
||||||
_state = state_closed;
|
_state = state_closed;
|
||||||
|
|
||||||
// invalid id, this channel can not exist
|
// invalid id, this channel can not exist
|
||||||
handler->onChannelError(_parent, "Max number of channels reached");
|
handler->onError(_parent, "Max number of channels reached");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,29 @@
|
||||||
*/
|
*/
|
||||||
namespace AMQP {
|
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
|
* Destructor
|
||||||
*/
|
*/
|
||||||
|
|
@ -27,18 +50,6 @@ ConnectionImpl::~ConnectionImpl()
|
||||||
close();
|
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
|
* 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
|
* is allowed to use, or 0 when no more ID's are available
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ bool ConnectionTuneFrame::process(ConnectionImpl *connection)
|
||||||
connection->send(okframe);
|
connection->send(okframe);
|
||||||
|
|
||||||
// and finally we start to open the frame
|
// and finally we start to open the frame
|
||||||
ConnectionOpenFrame openframe(connection->login().vhost());
|
ConnectionOpenFrame openframe(connection->vhost());
|
||||||
|
|
||||||
// send the open frame
|
// send the open frame
|
||||||
connection->send(openframe);
|
connection->send(openframe);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue