fixed compiler warning
This commit is contained in:
parent
428219ad83
commit
f0ad90dd65
|
|
@ -40,6 +40,34 @@ private:
|
||||||
{
|
{
|
||||||
std::cout << "connected" << std::endl;
|
std::cout << "connected" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method that is called when the TCP connection ends up in a ready
|
||||||
|
* @param connection The TCP connection
|
||||||
|
*/
|
||||||
|
virtual void onReady(AMQP::TcpConnection *connection) override
|
||||||
|
{
|
||||||
|
std::cout << "ready" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method that is called when the TCP connection is closed
|
||||||
|
* @param connection The TCP connection
|
||||||
|
*/
|
||||||
|
virtual void onClosed(AMQP::TcpConnection *connection) override
|
||||||
|
{
|
||||||
|
std::cout << "closed" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method that is called when the TCP connection is detached
|
||||||
|
* @param connection The TCP connection
|
||||||
|
*/
|
||||||
|
virtual void onDetached(AMQP::TcpConnection *connection) override
|
||||||
|
{
|
||||||
|
std::cout << "detached" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
|
@ -105,7 +133,7 @@ public:
|
||||||
_channel(channel), _queue(std::move(queue))
|
_channel(channel), _queue(std::move(queue))
|
||||||
{
|
{
|
||||||
// initialize the libev structure
|
// initialize the libev structure
|
||||||
ev_timer_init(&_timer, callback, 0.005, 0.005);
|
ev_timer_init(&_timer, callback, 0.005, 1.005);
|
||||||
|
|
||||||
// this object is the data
|
// this object is the data
|
||||||
_timer.data = this;
|
_timer.data = this;
|
||||||
|
|
@ -169,6 +197,8 @@ int main()
|
||||||
|
|
||||||
// construct a timer that is going to publish stuff
|
// construct a timer that is going to publish stuff
|
||||||
auto *timer = new MyTimer(loop, &channel, name);
|
auto *timer = new MyTimer(loop, &channel, name);
|
||||||
|
|
||||||
|
//connection.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
// run the loop
|
// run the loop
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ namespace AMQP {
|
||||||
* Forward declarations
|
* Forward declarations
|
||||||
*/
|
*/
|
||||||
class TcpState;
|
class TcpState;
|
||||||
|
class TcpChannel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class definition
|
* Class definition
|
||||||
|
|
@ -50,6 +51,12 @@ private:
|
||||||
* @var Connection
|
* @var Connection
|
||||||
*/
|
*/
|
||||||
Connection _connection;
|
Connection _connection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The channel may access out _connection
|
||||||
|
* @friend
|
||||||
|
*/
|
||||||
|
friend TcpChannel;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue