Skip to content

Instantly share code, notes, and snippets.

@ahundt
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahundt/97c7af569718de837c05 to your computer and use it in GitHub Desktop.
Save ahundt/97c7af569718de837c05 to your computer and use it in GitHub Desktop.
azmq fast send crash
//
// echo_server.cpp
// ~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2015 Andrew Hundt
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
//#include "grl/AzmqFlatbuffer.hpp"
//#include "grl/flatbuffer/Geometry_generated.h"
//#include "grl/flatbuffer/VrepControlPoint_generated.h"
//#include "grl/flatbuffer/VrepPath_generated.h"
#include "flatbuffers/flatbuffers.h"
#include <mutex>
#include <iostream>
#include <memory>
#include <thread>
#include <boost/asio.hpp>
#include <boost/asio/io_service.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/spawn.hpp>
#include <boost/asio/steady_timer.hpp>
#include <boost/asio/write.hpp>
#include <boost/asio/signal_set.hpp>
#include <boost/circular_buffer.hpp>
#include <boost/container/static_vector.hpp>
#include <azmq/socket.hpp>
#include <flatbuffers/flatbuffers.h>
/// @brief sends and receives flatbuffer data via AZMQ implementation of ZeroMQ plus manages the relevant buffers
///
/// Sending: This class provides a mechanism to asynchronously send google flatbuffers.
/// It also stores a pool of these buffers so that they don't need to be reallocated.
///
/// Rationale: FlatBufferBuilders are much faster if they are reused
/// so we create a small pool of them that you can get from this object
/// after you send a flat buffer, the builder is put into the pool
///
/// @todo the buffer pools may be a premature optimization. Evaluate this.
class AzmqFlatbuffer : public std::enable_shared_from_this<AzmqFlatbuffer>
{
public:
static const int default_circular_buffer_size = 10;
/// @todo Consider making this a simple std::vector so it is runtime configurable
typedef std::shared_ptr<boost::container::static_vector<uint8_t,256>> receive_buffer_type;
/// Initialize AzmqFlatbuffer with a socket.
/// The socket should be fully configured
/// and ready to use when it is passed to this object.
/// We also recommend the user utilizes AzmqFlatbuffer(std::move(socket))
/// when calling this constructor.
/// @see AzmqFlatbufferTest for an example of usage.
///
/// @todo consider making default_circular_buffer_size and receive_buffer_type configurable
explicit AzmqFlatbuffer(azmq::socket socket)
: socket_(std::move(socket)),
strand_(socket_.get_io_service()),
unusedFlatBufferBuilders_(default_circular_buffer_size),
unusedReceiveBuffers_(default_circular_buffer_size),
receiveBuffersWithData_(default_circular_buffer_size),
doneReceiving_(true)
{
for (int i = 0; i<default_circular_buffer_size; ++i) {
unusedFlatBufferBuilders_.push_back(std::make_shared<flatbuffers::FlatBufferBuilder>());
unusedReceiveBuffers_.push_back(std::make_shared<receive_buffer_type::element_type>());
}
}
/// Send a FlatbufferBuilder to the destination specified in the socket.
/// @todo make it so FlatBufferBuilders can be used directly without shared_ptr overhead.
///
/// @pre there are no other instances of fbbP (reference count of the shared_ptr should be 1)
///
/// @note the FlatBufferBuilder is automatically put back into the pool internal to this class after sending
void async_send_flatbuffer(std::shared_ptr<flatbuffers::FlatBufferBuilder> fbbP)
{
auto self(shared_from_this());
socket_.async_send(boost::asio::buffer(fbbP->GetBufferPointer(), fbbP->GetSize()), [this,self,fbbP] (boost::system::error_code const& ec, size_t bytes_transferred) {
if(ec) std::cout << "SendFlatBuffer error! todo: figure out how to handle this\n";
std::lock_guard<std::mutex> lock(this->unusedFlatBufferBuildersLock_);
fbbP->Clear();
this->unusedFlatBufferBuilders_.push_back(fbbP);
});
}
void shutdown(azmq::socket::shutdown_type sd,boost::system::error_code& ec){
socket_.shutdown(sd,ec);
}
void cancel(){
socket_.cancel();
}
/// destructor
/// @todo maybe do something useful with the error code from shutting down the socket?
~AzmqFlatbuffer(){
boost::system::error_code ec;
socket_.cancel();
socket_.shutdown(azmq::socket::shutdown_type::send,ec);
socket_.shutdown(azmq::socket::shutdown_type::receive,ec);
}
/// get a google FlatBufferBuilder object from the pool of unused objects
std::shared_ptr<flatbuffers::FlatBufferBuilder> GetUnusedBufferBuilder(){
std::lock_guard<std::mutex> lock(this->unusedFlatBufferBuildersLock_);
std::shared_ptr<flatbuffers::FlatBufferBuilder> back;
if (!unusedFlatBufferBuilders_.empty()) {
back = unusedFlatBufferBuilders_.back();
unusedFlatBufferBuilders_.pop_back();
} else {
/// @todo eliminate the need for this extra allocation, though this may be premature optimization
back = std::make_shared<flatbuffers::FlatBufferBuilder>();
}
return back;
}
/// Initializes the process of receiving
/// buffers from the source specified
/// by the azmq::socket taht was provided.
/// This initializes a loop that will continuously
/// read data and fill out the internal ring buffer
/// for users to extract. This allows this class to
/// run asynchronously while interacting with
/// synchronous users.
void start_async_receive_buffers(){
if(doneReceiving_){
doneReceiving_=false;
next_async_receive_buffers();
}
}
private:
/// read the next set of data from the zeromq interface in a loop.
/// This relies on the io_service for the loop, so that the stack
/// doesn't get used up.
///
/// @todo When the receiveBuffersWithData buffer is full, consider moving the oldest buffer to the "unused" buffer to save allocations.
void next_async_receive_buffers(){
receive_buffer_type rbP;
{ // this bracket is important so the lock is released ASAP
std::lock_guard<std::mutex> lock(receiveBuffersLock_);
if (!unusedReceiveBuffers_.empty()) {
rbP = unusedReceiveBuffers_.back();
unusedReceiveBuffers_.pop_back();
} else {
/// @todo eliminate the need for this extra allocation
rbP = std::make_shared<receive_buffer_type::element_type>();
}
}
// use the full capacity of the buffer
rbP->resize(rbP->capacity());
auto self(shared_from_this());
socket_.async_receive(boost::asio::buffer(&(rbP->begin()[0]),rbP->size()), [this,self,rbP](boost::system::error_code const ec, size_t bytes_transferred) {
if(ec) std::cout << "start_async_receive_buffers error! todo: figure out how to handle this\n";
// make rbp the size of the actual amount of data read
rbP->resize(std::min(bytes_transferred,rbP->capacity()));
std::lock_guard<std::mutex> lock(receiveBuffersLock_);
self->receiveBuffersWithData_.push_back(rbP);
// run this function again *after* it returns
if(!doneReceiving_) socket_.get_io_service().post(std::bind(&AzmqFlatbuffer::next_async_receive_buffers,this));
});
}
public:
/// Stop receiving buffers
void stop_async_receive_buffers(){
doneReceiving_ = true;
}
/// @return true if there are no buffers that have been received via the socket, false otherwise
bool receive_buffers_empty(){
std::lock_guard<std::mutex> lock(receiveBuffersLock_);
return receiveBuffersWithData_.empty();
}
/// @return The number of incoming buffers stored
std::size_t receive_buffers_size(){
std::lock_guard<std::mutex> lock(receiveBuffersLock_);
return receiveBuffersWithData_.size();
}
/// @return The number of possible incoming buffers that can be stored
std::size_t receive_buffers_capacity(){
std::lock_guard<std::mutex> lock(receiveBuffersLock_);
return receiveBuffersWithData_.capacity();
}
/// Inserts a range of values into the available receive buffers
///
/// @pre p must be a valid iterator of *this in range [begin(), end()].
/// @pre distance(first, last) <= capacity()
/// @pre Iterator must meet the ForwardTraversalIterator concept.
template<typename T>
void insert_unused_receive_buffers(T& range){
std::lock_guard<std::mutex> lock(receiveBuffersLock_);
unusedReceiveBuffers_.insert(unusedFlatBufferBuilders_.end(), range.begin(), range.end());
}
/// Put an unused buffer, or one that is no longer needed, back into the pool
void push_back_unused_receive_buffer(receive_buffer_type rb){
std::lock_guard<std::mutex> lock(receiveBuffersLock_);
unusedReceiveBuffers_.push_back(rb);
}
/// get the last, aka most chronologically recent, incoming buffer from the pool
receive_buffer_type get_back_receive_buffer_with_data(){
receive_buffer_type rbP;
std::lock_guard<std::mutex> lock(receiveBuffersLock_);
if (!receiveBuffersWithData_.empty()) {
rbP = receiveBuffersWithData_.back();
receiveBuffersWithData_.pop_back();
}
return rbP;
}
/// get the first, aka the chronologically oldest, incoming buffer from the pool
receive_buffer_type get_front_receive_buffer_with_data(){
receive_buffer_type rbP;
std::lock_guard<std::mutex> lock(receiveBuffersLock_);
if (!receiveBuffersWithData_.empty()) {
rbP = unusedReceiveBuffers_.front();
receiveBuffersWithData_.pop_front();
}
return rbP;
}
/// @brief Get all buffers from the pool at once and put them in an OutputIterator. This reduces locking/unlocking substantially.
template<typename OutputIterator>
void get_all_receive_buffers_with_data(OutputIterator it){
std::lock_guard<std::mutex> lock(receiveBuffersLock_);
std::copy(receiveBuffersWithData_.begin(), receiveBuffersWithData_.end(), it);
receiveBuffersWithData_.clear();
}
private:
/// @todo may need to create io_service::work object here to keep io_service from exiting run() call
azmq::socket socket_;
boost::asio::io_service::strand strand_;
/// @todo it is a bit unsafe to use shared pointers, but I'm not sure if it is possible to std::move FlatBufferBuilders themselves, or unique ptrs into lambda functions
boost::circular_buffer<std::shared_ptr<flatbuffers::FlatBufferBuilder>> unusedFlatBufferBuilders_;
std::mutex unusedFlatBufferBuildersLock_;
boost::circular_buffer<receive_buffer_type> unusedReceiveBuffers_;
boost::circular_buffer<receive_buffer_type> receiveBuffersWithData_;
std::mutex receiveBuffersLock_;
std::atomic<bool> doneReceiving_;
};
namespace grl {
namespace flatbuffer {
struct Vector3d;
struct EulerXYZd;
struct Quaternion;
MANUALLY_ALIGNED_STRUCT(8) Vector3d {
private:
double x_;
double y_;
double z_;
public:
Vector3d(double x, double y, double z)
: x_(flatbuffers::EndianScalar(x)), y_(flatbuffers::EndianScalar(y)), z_(flatbuffers::EndianScalar(z)) { }
double x() const { return flatbuffers::EndianScalar(x_); }
double y() const { return flatbuffers::EndianScalar(y_); }
double z() const { return flatbuffers::EndianScalar(z_); }
};
STRUCT_END(Vector3d, 24);
MANUALLY_ALIGNED_STRUCT(8) EulerXYZd {
private:
double rx_;
double ry_;
double rz_;
public:
EulerXYZd(double rx, double ry, double rz)
: rx_(flatbuffers::EndianScalar(rx)), ry_(flatbuffers::EndianScalar(ry)), rz_(flatbuffers::EndianScalar(rz)) { }
double rx() const { return flatbuffers::EndianScalar(rx_); }
double ry() const { return flatbuffers::EndianScalar(ry_); }
double rz() const { return flatbuffers::EndianScalar(rz_); }
};
STRUCT_END(EulerXYZd, 24);
MANUALLY_ALIGNED_STRUCT(8) Quaternion {
private:
double x_;
double y_;
double z_;
double w_;
public:
Quaternion(double x, double y, double z, double w)
: x_(flatbuffers::EndianScalar(x)), y_(flatbuffers::EndianScalar(y)), z_(flatbuffers::EndianScalar(z)), w_(flatbuffers::EndianScalar(w)) { }
double x() const { return flatbuffers::EndianScalar(x_); }
double y() const { return flatbuffers::EndianScalar(y_); }
double z() const { return flatbuffers::EndianScalar(z_); }
double w() const { return flatbuffers::EndianScalar(w_); }
};
STRUCT_END(Quaternion, 32);
} // namespace flatbuffer
} // namespace grl
namespace grl {
namespace flatbuffer {
struct Vector3d;
struct EulerXYZd;
struct Quaternion;
} // namespace flatbuffer
} // namespace grl
namespace grl {
namespace flatbuffer {
struct VrepControlPoint;
struct VrepControlPoint : private flatbuffers::Table {
const grl::flatbuffer::Vector3d *position() const { return GetStruct<const grl::flatbuffer::Vector3d *>(4); }
const grl::flatbuffer::EulerXYZd *rotation() const { return GetStruct<const grl::flatbuffer::EulerXYZd *>(6); }
double relativeVelocity() const { return GetField<double>(8, 1.0); }
int32_t bezierPointCount() const { return GetField<int32_t>(10, 1); }
double interpolationFactor1() const { return GetField<double>(12, 0.5); }
double interpolationFactor2() const { return GetField<double>(14, 0.5); }
double virtualDistance() const { return GetField<double>(16, 0.0); }
int32_t auxiliaryFlags() const { return GetField<int32_t>(18, 0); }
double auxiliaryChannel1() const { return GetField<double>(20, 0.0); }
double auxiliaryChannel2() const { return GetField<double>(22, 0.0); }
double auxiliaryChannel3() const { return GetField<double>(24, 0.0); }
double auxiliaryChannel4() const { return GetField<double>(26, 0.0); }
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<grl::flatbuffer::Vector3d>(verifier, 4 /* position */) &&
VerifyField<grl::flatbuffer::EulerXYZd>(verifier, 6 /* rotation */) &&
VerifyField<double>(verifier, 8 /* relativeVelocity */) &&
VerifyField<int32_t>(verifier, 10 /* bezierPointCount */) &&
VerifyField<double>(verifier, 12 /* interpolationFactor1 */) &&
VerifyField<double>(verifier, 14 /* interpolationFactor2 */) &&
VerifyField<double>(verifier, 16 /* virtualDistance */) &&
VerifyField<int32_t>(verifier, 18 /* auxiliaryFlags */) &&
VerifyField<double>(verifier, 20 /* auxiliaryChannel1 */) &&
VerifyField<double>(verifier, 22 /* auxiliaryChannel2 */) &&
VerifyField<double>(verifier, 24 /* auxiliaryChannel3 */) &&
VerifyField<double>(verifier, 26 /* auxiliaryChannel4 */) &&
verifier.EndTable();
}
};
struct VrepControlPointBuilder {
flatbuffers::FlatBufferBuilder &fbb_;
flatbuffers::uoffset_t start_;
void add_position(const grl::flatbuffer::Vector3d *position) { fbb_.AddStruct(4, position); }
void add_rotation(const grl::flatbuffer::EulerXYZd *rotation) { fbb_.AddStruct(6, rotation); }
void add_relativeVelocity(double relativeVelocity) { fbb_.AddElement<double>(8, relativeVelocity, 1.0); }
void add_bezierPointCount(int32_t bezierPointCount) { fbb_.AddElement<int32_t>(10, bezierPointCount, 1); }
void add_interpolationFactor1(double interpolationFactor1) { fbb_.AddElement<double>(12, interpolationFactor1, 0.5); }
void add_interpolationFactor2(double interpolationFactor2) { fbb_.AddElement<double>(14, interpolationFactor2, 0.5); }
void add_virtualDistance(double virtualDistance) { fbb_.AddElement<double>(16, virtualDistance, 0.0); }
void add_auxiliaryFlags(int32_t auxiliaryFlags) { fbb_.AddElement<int32_t>(18, auxiliaryFlags, 0); }
void add_auxiliaryChannel1(double auxiliaryChannel1) { fbb_.AddElement<double>(20, auxiliaryChannel1, 0.0); }
void add_auxiliaryChannel2(double auxiliaryChannel2) { fbb_.AddElement<double>(22, auxiliaryChannel2, 0.0); }
void add_auxiliaryChannel3(double auxiliaryChannel3) { fbb_.AddElement<double>(24, auxiliaryChannel3, 0.0); }
void add_auxiliaryChannel4(double auxiliaryChannel4) { fbb_.AddElement<double>(26, auxiliaryChannel4, 0.0); }
VrepControlPointBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
VrepControlPointBuilder &operator=(const VrepControlPointBuilder &);
flatbuffers::Offset<VrepControlPoint> Finish() {
auto o = flatbuffers::Offset<VrepControlPoint>(fbb_.EndTable(start_, 12));
return o;
}
};
inline flatbuffers::Offset<VrepControlPoint> CreateVrepControlPoint(flatbuffers::FlatBufferBuilder &_fbb,
const grl::flatbuffer::Vector3d *position = 0,
const grl::flatbuffer::EulerXYZd *rotation = 0,
double relativeVelocity = 1.0,
int32_t bezierPointCount = 1,
double interpolationFactor1 = 0.5,
double interpolationFactor2 = 0.5,
double virtualDistance = 0.0,
int32_t auxiliaryFlags = 0,
double auxiliaryChannel1 = 0.0,
double auxiliaryChannel2 = 0.0,
double auxiliaryChannel3 = 0.0,
double auxiliaryChannel4 = 0.0) {
VrepControlPointBuilder builder_(_fbb);
builder_.add_auxiliaryChannel4(auxiliaryChannel4);
builder_.add_auxiliaryChannel3(auxiliaryChannel3);
builder_.add_auxiliaryChannel2(auxiliaryChannel2);
builder_.add_auxiliaryChannel1(auxiliaryChannel1);
builder_.add_virtualDistance(virtualDistance);
builder_.add_interpolationFactor2(interpolationFactor2);
builder_.add_interpolationFactor1(interpolationFactor1);
builder_.add_relativeVelocity(relativeVelocity);
builder_.add_auxiliaryFlags(auxiliaryFlags);
builder_.add_bezierPointCount(bezierPointCount);
builder_.add_rotation(rotation);
builder_.add_position(position);
return builder_.Finish();
}
inline const VrepControlPoint *GetVrepControlPoint(const void *buf) { return flatbuffers::GetRoot<VrepControlPoint>(buf); }
inline bool VerifyVrepControlPointBuffer(flatbuffers::Verifier &verifier) { return verifier.VerifyBuffer<VrepControlPoint>(); }
inline void FinishVrepControlPointBuffer(flatbuffers::FlatBufferBuilder &fbb, flatbuffers::Offset<VrepControlPoint> root) { fbb.Finish(root); }
} // namespace flatbuffer
} // namespace grl
namespace grl {
namespace flatbuffer {
struct Vector3d;
struct EulerXYZd;
struct Quaternion;
} // namespace flatbuffer
} // namespace grl
namespace grl {
namespace flatbuffer {
struct VrepControlPoint;
} // namespace flatbuffer
} // namespace grl
namespace grl {
namespace flatbuffer {
struct VrepPath;
struct VrepPath : private flatbuffers::Table {
const flatbuffers::Vector<flatbuffers::Offset<grl::flatbuffer::VrepControlPoint>> *controlPoints() const { return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<grl::flatbuffer::VrepControlPoint>> *>(4); }
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* controlPoints */) &&
verifier.Verify(controlPoints()) &&
verifier.VerifyVectorOfTables(controlPoints()) &&
verifier.EndTable();
}
};
struct VrepPathBuilder {
flatbuffers::FlatBufferBuilder &fbb_;
flatbuffers::uoffset_t start_;
void add_controlPoints(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<grl::flatbuffer::VrepControlPoint>>> controlPoints) { fbb_.AddOffset(4, controlPoints); }
VrepPathBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
VrepPathBuilder &operator=(const VrepPathBuilder &);
flatbuffers::Offset<VrepPath> Finish() {
auto o = flatbuffers::Offset<VrepPath>(fbb_.EndTable(start_, 1));
return o;
}
};
inline flatbuffers::Offset<VrepPath> CreateVrepPath(flatbuffers::FlatBufferBuilder &_fbb,
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<grl::flatbuffer::VrepControlPoint>>> controlPoints = 0) {
VrepPathBuilder builder_(_fbb);
builder_.add_controlPoints(controlPoints);
return builder_.Finish();
}
inline const VrepPath *GetVrepPath(const void *buf) { return flatbuffers::GetRoot<VrepPath>(buf); }
inline bool VerifyVrepPathBuffer(flatbuffers::Verifier &verifier) { return verifier.VerifyBuffer<VrepPath>(); }
inline void FinishVrepPathBuffer(flatbuffers::FlatBufferBuilder &fbb, flatbuffers::Offset<VrepPath> root) { fbb.Finish(root); }
} // namespace flatbuffer
} // namespace grl
/// Send messages between a client and server asynchronously.
///
/// @see overview of zmq socket types https://sachabarbs.wordpress.com/2014/08/21/zeromq-2-the-socket-types-2/
/// @see bounce is based on https://github.com/zeromq/azmq/blob/master/test/socket/main.cpp
/// @see flatbuffers https://google.github.io/flatbuffers/md__cpp_usage.html
void bounce(std::shared_ptr<AzmqFlatbuffer> sendP, std::shared_ptr<AzmqFlatbuffer> receiveP, bool shouldReceive = true) {
receiveP->start_async_receive_buffers();
for (int x = 0; x<1000; ++x) {
/////////////////////////////////////////
// Client sends to server asynchronously!
{
auto fbbP = sendP->GetUnusedBufferBuilder();
grl::flatbuffer::Vector3d rv(x,0,0);
auto controlPoint = grl::flatbuffer::CreateVrepControlPoint(*fbbP,&rv);
grl::flatbuffer::FinishVrepControlPointBuffer(*fbbP, controlPoint);
sendP->async_send_flatbuffer(fbbP);
}
//////////////////////////////////////////////
// Server receives from client asynchronously!
while (shouldReceive && !receiveP->receive_buffers_empty()) {
auto rbP = receiveP->get_back_receive_buffer_with_data();
auto rbPstart = &(rbP->begin()[0]);
auto verifier = flatbuffers::Verifier(rbPstart,rbP->size());
auto bufOK = grl::flatbuffer::VerifyVrepControlPointBuffer(verifier);
if(bufOK){
const grl::flatbuffer::VrepControlPoint* VCPin = grl::flatbuffer::GetVrepControlPoint(rbPstart);
std::cout << "received: " << VCPin->position()->x() << "\n";
} else {
std::cout << "Failed verification. bufOk: " <<bufOK << "\n";
}
}
//std::this_thread::sleep_for( std::chrono::milliseconds(1) );
}
}
int main(int argc, char* argv[])
{
// try
// {
std::string localhost("127.0.0.1");
std::string localport("9998");
std::string remotehost("127.0.0.1");
std::string remoteport("9998");
std::cout << "argc: " << argc << "\n";
/// @todo add default localhost/localport
if (argc != 5 && argc != 1 && argc != 3)
{
std::cerr << "Usage: " << argv[0] << " <localip> <localport> <remoteip> <remoteport>\n";
return 1;
}
bool shouldReceive = true;
if(argc == 3){
remotehost = std::string(argv[1]);
remoteport = std::string(argv[2]);
shouldReceive = false;
}
if(argc == 5){
localhost = std::string(argv[1]);
localport = std::string(argv[2]);
remotehost = std::string(argv[3]);
remoteport = std::string(argv[4]);
shouldReceive = true;
}
std::cout << "using: " << argv[0] << " ";
if(shouldReceive) std::cout << localhost << " " << localport << " ";
std::cout << remotehost << " " << remoteport << "\n";
boost::asio::io_service io_service;
// Register signal handlers so that the daemon may be shut down when a signal is received.
boost::asio::signal_set signals(io_service, SIGINT, SIGTERM);
signals.async_wait( std::bind(&boost::asio::io_service::stop, &io_service));
#if 0
std::shared_ptr<AzmqFlatbuffer> sendP;
{
boost::system::error_code ec;
azmq::socket socket(io_service, ZMQ_DEALER);
socket.connect("tcp://"+ remotehost + ":" + remoteport);
sendP = std::make_shared<AzmqFlatbuffer>(std::move(socket));
}
std::shared_ptr<AzmqFlatbuffer> receiveP;
{
boost::system::error_code ec;
azmq::socket socket(io_service, ZMQ_DEALER);
socket.bind("tcp://" + localhost + ":" + localport);
receiveP = std::make_shared<AzmqFlatbuffer>(std::move(socket));
}
// Will run until signal is received, using separate objects for send and receive
std::thread t(bounce,sendP,receiveP);
#else
std::shared_ptr<AzmqFlatbuffer> receiveP;
{
boost::system::error_code ec;
azmq::socket socket(io_service, ZMQ_DEALER);
socket.bind("tcp://" + localhost + ":" + localport);
socket.connect("tcp://"+ remotehost + ":" + remoteport);
receiveP = std::make_shared<AzmqFlatbuffer>(std::move(socket));
}
// Will run until signal is received, using one object for both send and receive
std::thread t(bounce,receiveP,receiveP,shouldReceive);
#endif
io_service.run();
t.join();
// }
// catch (std::exception& e)
// {
// std::cerr << "Exception: " << e.what() << "\n";
// }
return 0;
}
//
// echo_server.cpp
// ~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2015 Andrew Hundt
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include <mutex>
#include <iostream>
#include <memory>
#include <thread>
#include <boost/asio.hpp>
#include <boost/asio/io_service.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/spawn.hpp>
#include <boost/asio/steady_timer.hpp>
#include <boost/asio/write.hpp>
#include <boost/asio/signal_set.hpp>
#include <boost/circular_buffer.hpp>
#include <boost/container/static_vector.hpp>
#include <azmq/socket.hpp>
/// Send messages between a client and server asynchronously.
///
/// @see overview of zmq socket types https://sachabarbs.wordpress.com/2014/08/21/zeromq-2-the-socket-types-2/
/// @see bounce is based on https://github.com/zeromq/azmq/blob/master/test/socket/main.cpp
/// @see flatbuffers https://google.github.io/flatbuffers/md__cpp_usage.html
void bounce(std::shared_ptr<azmq::socket> sendP, std::shared_ptr<azmq::socket> receiveP, bool shouldReceive = true) {
std::atomic<int> recv_count(0);
std::atomic<int> send_count(0);
constexpr int messagesToSend = 1000;
for (int x = 0; x<messagesToSend; ++x) {
/////////////////////////////////////////
// Client sends to server asynchronously!
{
sendP->async_send(boost::asio::buffer(&x, 4), [x,&sendP,&send_count] (boost::system::error_code const& ec, size_t bytes_transferred) {
if(ec) std::cout << "SendFlatBuffer error! todo: figure out how to handle this\n";
else {
std::cout << "sent: " << x << "\n";
send_count++;
}
});
}
//////////////////////////////////////////////
// Server receives from client asynchronously!
while (shouldReceive && recv_count < send_count ) {
std::shared_ptr<int> recvBufP(std::make_shared<int>(0));
BOOST_VERIFY(*recvBufP == 0);
receiveP->async_receive(boost::asio::buffer(recvBufP.get(),sizeof(*recvBufP)), [recvBufP,receiveP,&recv_count, messagesToSend](boost::system::error_code const ec, size_t bytes_transferred) {
if(ec) std::cout << "start_async_receive_buffers error! todo: figure out how to handle this\n";
else std::cout << "received: " << *recvBufP << " recv_count:" << recv_count << "\n";
// make rbp the size of the actual amount of data read
recv_count++;
});
}
//std::this_thread::sleep_for( std::chrono::milliseconds(1) );
}
sendP.reset();
receiveP.reset();
}
int main(int argc, char* argv[])
{
// try
// {
std::string localhost("127.0.0.1");
std::string localport("9998");
std::string remotehost("127.0.0.1");
std::string remoteport("9998");
std::cout << "argc: " << argc << "\n";
/// @todo add default localhost/localport
if (argc != 5 && argc != 1 && argc != 3)
{
std::cerr << "Usage: " << argv[0] << " <localip> <localport> <remoteip> <remoteport>\n";
return 1;
}
bool shouldReceive = true;
if(argc == 3){
remotehost = std::string(argv[1]);
remoteport = std::string(argv[2]);
shouldReceive = false;
}
if(argc == 5){
localhost = std::string(argv[1]);
localport = std::string(argv[2]);
remotehost = std::string(argv[3]);
remoteport = std::string(argv[4]);
shouldReceive = true;
}
std::cout << "using: " << argv[0] << " ";
if(shouldReceive) std::cout << localhost << " " << localport << " ";
std::cout << remotehost << " " << remoteport << "\n";
boost::asio::io_service io_service;
std::thread thr;
// Register signal handlers so that the daemon may be shut down when a signal is received.
boost::asio::signal_set signals(io_service, SIGINT, SIGTERM);
signals.async_wait( std::bind(&boost::asio::io_service::stop, &io_service));
std::shared_ptr<azmq::socket> socket = std::make_shared<azmq::socket>(io_service, ZMQ_DEALER);
socket->bind("tcp://" + localhost + ":" + localport);
socket->connect("tcp://"+ remotehost + ":" + remoteport);
// Will run until signal is received, using one object for both send and receive
thr = std::thread(bounce,socket,socket,shouldReceive);
io_service.run();
thr.join();
// }
// catch (std::exception& e)
// {
// std::cerr << "Exception: " << e.what() << "\n";
// }
return 0;
}
sent: 0
sent: 1
received: 0 recv_count:0
received: 1 recv_count:1
sent: 2
received: 2 recv_count:2
sent: 3
received: 3 recv_count:3
sent: 4
received: 4 recv_count:4
sent: 5
sent: 6
sent: 7
sent: 8
sent: 9
sent: 10
sent: 11
sent: 12
sent: 13
sent: 14
sent: 15
sent: 16
sent: 17
sent: 18
sent: 19
sent: 20
sent: 21
sent: 22
sent: 23
sent: 24
sent: 25
sent: 26
sent: 27
sent: 28
sent: 29
sent: 30
sent: 31
sent: 32
sent: 33
sent: 34
sent: 35
sent: 36
sent: 37
sent: 38
sent: 39
sent: 40
sent: 41
sent: 42
sent: 43
sent: 44
sent: 45
sent: 46
sent: 47
sent: 48
sent: 49
sent: 50
sent: 51
sent: 52
sent: 53
sent: 54
sent: 55
sent: 56
sent: 57
sent: 58
sent: 59
sent: 60
sent: 61
sent: 62
sent: 63
sent: 64
sent: 65
sent: 66
sent: 67
sent: 68
sent: 69
sent: 70
sent: 71
sent: 72
sent: 73
sent: 74
sent: 75
sent: 76
sent: 77
sent: 78
sent: 79
sent: 80
sent: 81
sent: 82
sent: 83
sent: 84
sent: 85
sent: 86
sent: 87
sent: 88
sent: 89
sent: 90
sent: 91
sent: 92
sent: 93
received: 93 recv_count:5
received: 93 recv_count:6
received: 93 recv_count:7
received: 93 recv_count:8
received: 93 recv_count:9
received: 93 recv_count:10
received: 93 recv_count:11
received: 93 recv_count:12
received: 93 recv_count:13
received: 93 recv_count:14
received: 93 recv_count:15
received: 93 recv_count:16
received: 93 recv_count:17
received: 93 recv_count:18
received: 93 recv_count:19
received: 93 recv_count:20
received: 93 recv_count:21
received: 93 recv_count:22
received: 93 recv_count:23
received: 93 recv_count:24
received: 93 recv_count:25
received: 93 recv_count:26
received: 93 recv_count:27
received: 93 recv_count:28
received: 93 recv_count:29
received: 93 recv_count:30
received: 93 recv_count:31
received: 93 recv_count:32
received: 93 recv_count:33
received: 93 recv_count:34
received: 93 recv_count:35
received: 93 recv_count:36
received: 93 recv_count:37
received: 93 recv_count:38
received: 93 recv_count:39
received: 93 recv_count:40
received: 93 recv_count:41
received: 93 recv_count:42
received: 93 recv_count:43
received: 93 recv_count:44
received: 93 recv_count:45
received: 93 recv_count:46
received: 93 recv_count:47
received: 93 recv_count:48
received: 93 recv_count:49
received: 93 recv_count:50
received: 93 recv_count:51
received: 93 recv_count:52
received: 93 recv_count:53
received: 93 recv_count:54
received: 93 recv_count:55
received: 93 recv_count:56
received: 93 recv_count:57
received: 93 recv_count:58
received: 93 recv_count:59
received: 93 recv_count:60
received: 93 recv_count:61
received: 93 recv_count:62
received: 93 recv_count:63
received: 93 recv_count:64
received: 93 recv_count:65
received: 93 recv_count:66
received: 93 recv_count:67
received: 93 recv_count:68
received: 93 recv_count:69
received: 93 recv_count:70
received: 93 recv_count:71
received: 93 recv_count:72
received: 93 recv_count:73
received: 93 recv_count:74
received: 93 recv_count:75
received: 93 recv_count:76
received: 93 recv_count:77
received: 93 recv_count:78
received: 93 recv_count:79
received: 93 recv_count:80
received: 93 recv_count:81
received: 93 recv_count:82
received: 93 recv_count:83
received: 93 recv_count:84
received: 93 recv_count:85
received: 93 recv_count:86
received: 93 recv_count:87
received: 93 recv_count:88
received: 93 recv_count:89
received: 93 recv_count:90
received: 93 recv_count:91
received: 93 recv_count:92
received: 93 recv_count:93
sent: 94
sent: 95
sent: 96
received: 94 recv_count:94
received: 96 recv_count:95
received: 96 recv_count:96
sent: 97
received: 97 recv_count:97
sent: 98
sent: 99
received: 98 recv_count:98
received: 99 recv_count:99
sent: 100
sent: 101
received: 100 recv_count:100
sent: 102
sent: 103
sent: 104
sent: 105
sent: 106
sent: 107
sent: 108
sent: 109
sent: 110
sent: 111
sent: 112
sent: 113
sent: 114
sent: 115
sent: 116
sent: 117
sent: 118
sent: 119
sent: 120
sent: 121
sent: 122
sent: 123
sent: 124
sent: 125
sent: 126
sent: 127
sent: 128
received: 128 recv_count:101
received: 128 recv_count:102
received: 128 recv_count:103
received: 128 recv_count:104
received: 128 recv_count:105
received: 128 recv_count:106
received: 128 recv_count:107
received: 128 recv_count:108
received: 128 recv_count:109
received: 128 recv_count:110
received: 128 recv_count:111
received: 128 recv_count:112
received: 128 recv_count:113
received: 128 recv_count:114
received: 128 recv_count:115
received: 128 recv_count:116
received: 128 recv_count:117
received: 128 recv_count:118
received: 128 recv_count:119
received: 128 recv_count:120
received: 128 recv_count:121
received: 128 recv_count:122
received: 128 recv_count:123
received: 128 recv_count:124
received: 128 recv_count:125
received: 128 recv_count:126
received: 128 recv_count:127
received: 128 recv_count:128
sent: 129
sent: 130
sent: 131
sent: 132
sent: 133
sent: 134
sent: 135
sent: 136
sent: 137
sent: 138
sent: 139
sent: 140
sent: 141
sent: 142
sent: 143
sent: 144
sent: 145
sent: 146
sent: 147
sent: 148
sent: 149
sent: 150
sent: 151
sent: 152
sent: 153
sent: 154
sent: 155
sent: 156
sent: 157
received: 129 recv_count:129
received: 157 recv_count:130
received: 157 recv_count:131
received: 157 recv_count:132
received: 157 recv_count:133
received: 157 recv_count:134
received: 157 recv_count:135
received: 157 recv_count:136
received: 157 recv_count:137
received: 157 recv_count:138
received: 157 recv_count:139
received: 157 recv_count:140
received: 157 recv_count:141
received: 157 recv_count:142
received: 157 recv_count:143
received: 157 recv_count:144
received: 157 recv_count:145
received: 157 recv_count:146
received: 157 recv_count:147
received: 157 recv_count:148
received: 157 recv_count:149
received: 157 recv_count:150
received: 157 recv_count:151
received: 157 recv_count:152
received: 157 recv_count:153
received: 157 recv_count:154
received: 157 recv_count:155
received: 157 recv_count:156
received: 157 recv_count:157
sent: 158
received: 158 recv_count:158
sent: 159
sent: 160
sent: 161
sent: 162
sent: 163
sent: 164
sent: 165
sent: 166
sent: 167
sent: 168
sent: 169
sent: 170
sent: 171
sent: 172
sent: 173
sent: 174
sent: 175
sent: 176
sent: 177
sent: 178
sent: 179
sent: 180
sent: 181
sent: 182
sent: 183
sent: 184
sent: 185
sent: 186
sent: 187
sent: 188
sent: 189
sent: 190
sent: 191
sent: 192
sent: 193
sent: 194
sent: 195
sent: 196
sent: 197
sent: 198
sent: 199
sent: 200
sent: 201
sent: 202
sent: 203
sent: 204
sent: 205
sent: 206
sent: 207
sent: 208
sent: 209
sent: 210
sent: 211
sent: 212
sent: 213
sent: 214
sent: 215
sent: 216
sent: 217
sent: 218
sent: 219
sent: 220
sent: 221
sent: 222
sent: 223
sent: 224
sent: 225
sent: 226
sent: 227
sent: 228
sent: 229
sent: 230
sent: 231
sent: 232
sent: 233
sent: 234
sent: 235
sent: 236
sent: 237
sent: 238
sent: 239
sent: 240
sent: 241
sent: 242
sent: 243
sent: 244
sent: 245
sent: 246
sent: 247
sent: 248
sent: 249
sent: 250
sent: 251
sent: 252
sent: 253
sent: 254
sent: 255
sent: 256
sent: 257
sent: 258
sent: 259
sent: 260
sent: 261
sent: 262
sent: 263
sent: 264
sent: 265
sent: 266
sent: 267
received: 354 recv_count:159
sent: 268
received: 354 recv_count:160
sent: 269
received: 354 recv_count:161
sent: 270
received: 354 recv_count:162
sent: 271
received: 354 recv_count:163
sent: 272
received: 354 recv_count:164
sent: 273
received: 354 recv_count:165
sent: 274
received: 354 recv_count:166
sent: 275
received: 354 recv_count:167
sent: 276
received: 354 recv_count:168
sent: 277
received: 354 recv_count:169
sent: 278
received: 354 recv_count:170
sent: 279
received: 354 recv_count:171
sent: 280
received: 354 recv_count:172
sent: 281
received: 354 recv_count:173
sent: 282
received: 354 recv_count:174
sent: 283
received: 354 recv_count:175
sent: 284
received: 354 recv_count:176
sent: 285
received: 354 recv_count:177
sent: 286
received: 354 recv_count:178
sent: 287
received: 354 recv_count:179
sent: 288
received: 354 recv_count:180
sent: 289
received: 354 recv_count:181
sent: 290
received: 354 recv_count:182
sent: 291
received: 354 recv_count:183
sent: 292
received: 354 recv_count:184
sent: 293
received: 354 recv_count:185
sent: 294
received: 354 recv_count:186
sent: 295
received: 354 recv_count:187
sent: 296
received: 354 recv_count:188
sent: 297
received: 354 recv_count:189
sent: 298
received: 354 recv_count:190
sent: 299
received: 354 recv_count:191
sent: 300
received: 354 recv_count:192
sent: 301
received: 354 recv_count:193
sent: 302
received: 354 recv_count:194
sent: 303
received: 354 recv_count:195
sent: 304
received: 354 recv_count:196
sent: 305
received: 354 recv_count:197
sent: 306
received: 354 recv_count:198
sent: 307
received: 354 recv_count:199
sent: 308
received: 354 recv_count:200
sent: 309
received: 354 recv_count:201
sent: 310
received: 354 recv_count:202
sent: 311
received: 354 recv_count:203
sent: 312
received: 354 recv_count:204
sent: 313
received: 354 recv_count:205
sent: 314
received: 354 recv_count:206
sent: 315
received: 354 recv_count:207
sent: 316
received: 354 recv_count:208
sent: 317
received: 354 recv_count:209
sent: 318
received: 354 recv_count:210
sent: 319
received: 354 recv_count:211
sent: 320
received: 354 recv_count:212
sent: 321
received: 354 recv_count:213
sent: 322
received: 354 recv_count:214
sent: 323
received: 354 recv_count:215
sent: 324
received: 354 recv_count:216
sent: 325
received: 354 recv_count:217
sent: 326
received: 354 recv_count:218
sent: 327
received: 354 recv_count:219
sent: 328
received: 354 recv_count:220
sent: 329
received: 354 recv_count:221
sent: 330
received: 354 recv_count:222
sent: 331
received: 354 recv_count:223
sent: 332
received: 354 recv_count:224
sent: 333
received: 354 recv_count:225
sent: 334
received: 354 recv_count:226
sent: 335
received: 354 recv_count:227
sent: 336
received: 354 recv_count:228
sent: 337
received: 354 recv_count:229
sent: 338
received: 354 recv_count:230
sent: 339
received: 354 recv_count:231
sent: 340
received: 354 recv_count:232
sent: 341
received: 354 recv_count:233
sent: 342
received: 354 recv_count:234
sent: 343
received: 354 recv_count:235
sent: 344
received: 354 recv_count:236
sent: 345
received: 354 recv_count:237
sent: 346
received: 354 recv_count:238
sent: 347
received: 354 recv_count:239
sent: 348
received: 354 recv_count:240
sent: 349
received: 354 recv_count:241
sent: 350
received: 354 recv_count:242
sent: 351
received: 354 recv_count:243
sent: 352
received: 354 recv_count:244
sent: 353
received: 354 recv_count:245
sent: 354
received: 354 recv_count:246
received: 354 recv_count:247
received: 354 recv_count:248
received: 354 recv_count:249
received: 354 recv_count:250
received: 354 recv_count:251
received: 354 recv_count:252
received: 354 recv_count:253
received: 354 recv_count:254
received: 354 recv_count:255
received: 354 recv_count:256
received: 354 recv_count:257
received: 354 recv_count:258
received: 354 recv_count:259
received: 354 recv_count:260
received: 354 recv_count:261
received: 354 recv_count:262
received: 354 recv_count:263
received: 354 recv_count:264
received: 354 recv_count:265
received: 354 recv_count:266
received: 354 recv_count:267
received: 354 recv_count:268
received: 354 recv_count:269
received: 354 recv_count:270
received: 354 recv_count:271
received: 354 recv_count:272
received: 354 recv_count:273
received: 354 recv_count:274
received: 354 recv_count:275
received: 354 recv_count:276
received: 354 recv_count:277
received: 354 recv_count:278
received: 354 recv_count:279
received: 354 recv_count:280
received: 354 recv_count:281
received: 354 recv_count:282
received: 354 recv_count:283
received: 354 recv_count:284
received: 354 recv_count:285
received: 354 recv_count:286
received: 354 recv_count:287
received: 354 recv_count:288
received: 354 recv_count:289
received: 354 recv_count:290
received: 354 recv_count:291
received: 354 recv_count:292
received: 354 recv_count:293
received: 354 recv_count:294
received: 354 recv_count:295
received: 354 recv_count:296
received: 354 recv_count:297
received: 354 recv_count:298
received: 354 recv_count:299
received: 354 recv_count:300
received: 354 recv_count:301
received: 354 recv_count:302
received: 354 recv_count:303
received: 354 recv_count:304
received: 354 recv_count:305
received: 354 recv_count:306
received: 354 recv_count:307
received: 354 recv_count:308
received: 354 recv_count:309
received: 354 recv_count:310
received: 354 recv_count:311
received: 354 recv_count:312
received: 354 recv_count:313
received: 354 recv_count:314
received: 354 recv_count:315
received: 354 recv_count:316
received: 354 recv_count:317
received: 354 recv_count:318
received: 354 recv_count:319
received: 354 recv_count:320
received: 354 recv_count:321
received: 354 recv_count:322
received: 354 recv_count:323
received: 354 recv_count:324
received: 354 recv_count:325
received: 354 recv_count:326
received: 354 recv_count:327
received: 354 recv_count:328
received: 354 recv_count:329
received: 354 recv_count:330
received: 354 recv_count:331
received: 354 recv_count:332
received: 354 recv_count:333
received: 354 recv_count:334
received: 354 recv_count:335
received: 354 recv_count:336
received: 354 recv_count:337
received: 354 recv_count:338
received: 354 recv_count:339
received: 354 recv_count:340
received: 354 recv_count:341
received: 354 recv_count:342
received: 354 recv_count:343
received: 354 recv_count:344
received: 354 recv_count:345
received: 354 recv_count:346
received: 354 recv_count:347
received: 354 recv_count:348
received: 354 recv_count:349
received: 354 recv_count:350
received: 354 recv_count:351
received: 354 recv_count:352
received: 354 recv_count:353
received: 354 recv_count:354
sent: 355
received: 355 recv_count:355
sent: 356
received: 356 recv_count:356
sent: 357
received: 357 recv_count:357
sent: 358
received: 358 recv_count:358
sent: 359
sent: 360
sent: 361
sent: 362
received: 359 recv_count:359
sent: 363
sent: 364
sent: 365
sent: 366
received: 366 recv_count:360
received: 366 recv_count:361
received: 366 recv_count:362
received: 366 recv_count:363
received: 366 recv_count:364
received: 366 recv_count:365
received: 366 recv_count:366
sent: 367
received: 367 recv_count:367
sent: 368
sent: 369
received: 368 recv_count:368
received: 369 recv_count:369
sent: 370
received: 370 recv_count:370
sent: 371
sent: 372
received: 371 recv_count:371
received: 372 recv_count:372
sent: 373
received: 373 recv_count:373
sent: 374
sent: 375
sent: 376
sent: 377
sent: 378
sent: 379
sent: 380
sent: 381
sent: 382
sent: 383
sent: 384
sent: 385
sent: 386
sent: 387
sent: 388
sent: 389
sent: 390
sent: 391
sent: 392
sent: 393
sent: 394
sent: 395
sent: 396
sent: 397
sent: 398
received: 398 recv_count:374
received: 398 recv_count:375
received: 398 recv_count:376
received: 398 recv_count:377
received: 398 recv_count:378
received: 398 recv_count:379
received: 398 recv_count:380
received: 398 recv_count:381
received: 398 recv_count:382
received: 398 recv_count:383
received: 398 recv_count:384
received: 398 recv_count:385
received: 398 recv_count:386
received: 398 recv_count:387
received: 398 recv_count:388
received: 398 recv_count:389
received: 398 recv_count:390
received: 398 recv_count:391
received: 398 recv_count:392
received: 398 recv_count:393
received: 398 recv_count:394
received: 398 recv_count:395
received: 398 recv_count:396
received: 398 recv_count:397
received: 398 recv_count:398
sent: 399
received: 399 recv_count:399
sent: 400
sent: 401
sent: 402
sent: 403
sent: 404
sent: 405
sent: 406
sent: 407
sent: 408
sent: 409
sent: 410
sent: 411
sent: 412
sent: 413
sent: 414
sent: 415
sent: 416
sent: 417
sent: 418
sent: 419
sent: 420
sent: 421
sent: 422
sent: 423
sent: 424
sent: 425
sent: 426
sent: 427
sent: 428
sent: 429
sent: 430
sent: 431
sent: 432
sent: 433
sent: 434
sent: 435
sent: 436
sent: 437
sent: 438
sent: 439
sent: 440
sent: 441
sent: 442
sent: 443
sent: 444
sent: 445
sent: 446
sent: 447
sent: 448
sent: 449
sent: 450
sent: 451
sent: 452
sent: 453
sent: 454
sent: 455
sent: 456
sent: 457
sent: 458
sent: 459
sent: 460
sent: 461
sent: 462
sent: 463
sent: 464
sent: 465
sent: 466
sent: 467
sent: 468
sent: 469
sent: 470
sent: 471
sent: 472
sent: 473
sent: 474
sent: 475
sent: 476
sent: 477
sent: 478
sent: 479
sent: 480
sent: 481
sent: 482
sent: 483
sent: 484
sent: 485
sent: 486
sent: 487
received: 487 recv_count:400
received: 487 recv_count:401
received: 487 recv_count:402
received: 487 recv_count:403
received: 487 recv_count:404
received: 487 recv_count:405
received: 487 recv_count:406
received: 487 recv_count:407
received: 487 recv_count:408
received: 487 recv_count:409
received: 487 recv_count:410
received: 487 recv_count:411
received: 487 recv_count:412
received: 487 recv_count:413
received: 487 recv_count:414
received: 487 recv_count:415
received: 487 recv_count:416
received: 487 recv_count:417
received: 487 recv_count:418
received: 487 recv_count:419
received: 487 recv_count:420
received: 487 recv_count:421
received: 487 recv_count:422
received: 487 recv_count:423
received: 487 recv_count:424
received: 487 recv_count:425
received: 487 recv_count:426
received: 487 recv_count:427
received: 487 recv_count:428
received: 487 recv_count:429
received: 487 recv_count:430
received: 487 recv_count:431
received: 487 recv_count:432
received: 487 recv_count:433
received: 487 recv_count:434
received: 487 recv_count:435
received: 487 recv_count:436
received: 487 recv_count:437
received: 487 recv_count:438
received: 487 recv_count:439
received: 487 recv_count:440
received: 487 recv_count:441
received: 487 recv_count:442
received: 487 recv_count:443
received: 487 recv_count:444
received: 487 recv_count:445
received: 487 recv_count:446
received: 487 recv_count:447
received: 487 recv_count:448
received: 487 recv_count:449
received: 487 recv_count:450
received: 487 recv_count:451
received: 487 recv_count:452
received: 487 recv_count:453
received: 487 recv_count:454
received: 487 recv_count:455
received: 487 recv_count:456
received: 487 recv_count:457
received: 487 recv_count:458
received: 487 recv_count:459
received: 487 recv_count:460
received: 487 recv_count:461
received: 487 recv_count:462
received: 487 recv_count:463
received: 487 recv_count:464
received: 487 recv_count:465
received: 487 recv_count:466
received: 487 recv_count:467
received: 487 recv_count:468
received: 487 recv_count:469
received: 487 recv_count:470
received: 487 recv_count:471
received: 487 recv_count:472
received: 487 recv_count:473
received: 487 recv_count:474
received: 487 recv_count:475
received: 487 recv_count:476
received: 487 recv_count:477
received: 487 recv_count:478
received: 487 recv_count:479
received: 487 recv_count:480
received: 487 recv_count:481
received: 487 recv_count:482
received: 487 recv_count:483
received: 487 recv_count:484
received: 487 recv_count:485
received: 487 recv_count:486
received: 487 recv_count:487
sent: 488
received: 488 recv_count:488
sent: 489
received: 489 recv_count:489
sent: 490
received: 490 recv_count:490
sent: 491
received: 491 recv_count:491
sent: 492
sent: 493
received: 492 recv_count:492
sent: 494
sent: 495
sent: 496
sent: 497
sent: 498
sent: 499
sent: 500
sent: 501
sent: 502
sent: 503
sent: 504
sent: 505
sent: 506
sent: 507
received: 507 recv_count:493
received: 507 recv_count:494
received: 507 recv_count:495
received: 507 recv_count:496
received: 507 recv_count:497
received: 507 recv_count:498
received: 507 recv_count:499
received: 507 recv_count:500
received: 507 recv_count:501
received: 507 recv_count:502
received: 507 recv_count:503
received: 507 recv_count:504
received: 507 recv_count:505
received: 507 recv_count:506
received: 507 recv_count:507
sent: 508
sent: 509
sent: 510
received: 508 recv_count:508
sent: 511
sent: 512
sent: 513
sent: 514
sent: 515
sent: 516
sent: 517
sent: 518
sent: 519
sent: 520
sent: 521
sent: 522
sent: 523
sent: 524
sent: 525
sent: 526
received: 526 recv_count:509
received: 526 recv_count:510
received: 526 recv_count:511
received: 526 recv_count:512
received: 526 recv_count:513
received: 526 recv_count:514
received: 526 recv_count:515
received: 526 recv_count:516
received: 526 recv_count:517
received: 526 recv_count:518
received: 526 recv_count:519
received: 526 recv_count:520
received: 526 recv_count:521
received: 526 recv_count:522
received: 526 recv_count:523
received: 526 recv_count:524
received: 526 recv_count:525
received: 526 recv_count:526
sent: 527
received: 527 recv_count:527
sent: 528
sent: 529
sent: 530
sent: 531
sent: 532
sent: 533
sent: 534
sent: 535
sent: 536
sent: 537
sent: 538
sent: 539
sent: 540
sent: 541
sent: 542
sent: 543
sent: 544
sent: 545
sent: 546
sent: 547
sent: 548
received: 548 recv_count:528
received: 548 recv_count:529
received: 548 recv_count:530
received: 548 recv_count:531
received: 548 recv_count:532
received: 548 recv_count:533
received: 548 recv_count:534
received: 548 recv_count:535
received: 548 recv_count:536
received: 548 recv_count:537
received: 548 recv_count:538
received: 548 recv_count:539
received: 548 recv_count:540
received: 548 recv_count:541
received: 548 recv_count:542
received: 548 recv_count:543
received: 548 recv_count:544
received: 548 recv_count:545
received: 548 recv_count:546
received: 548 recv_count:547
received: 548 recv_count:548
sent: 549
sent: 550
received: 549 recv_count:549
sent: 551
sent: 552
sent: 553
sent: 554
sent: 555
sent: 556
sent: 557
sent: 558
sent: 559
sent: 560
sent: 561
sent: 562
sent: 563
sent: 564
sent: 565
sent: 566
sent: 567
sent: 568
sent: 569
sent: 570
sent: 571
sent: 572
sent: 573
sent: 574
sent: 575
sent: 576
sent: 577
sent: 578
sent: 579
sent: 580
sent: 581
sent: 582
sent: 583
sent: 584
sent: 585
sent: 586
sent: 587
sent: 588
sent: 589
sent: 590
sent: 591
sent: 592
received: 592 recv_count:550
received: 592 recv_count:551
received: 592 recv_count:552
received: 592 recv_count:553
received: 592 recv_count:554
received: 592 recv_count:555
received: 592 recv_count:556
received: 592 recv_count:557
received: 592 recv_count:558
received: 592 recv_count:559
received: 592 recv_count:560
received: 592 recv_count:561
received: 592 recv_count:562
received: 592 recv_count:563
received: 592 recv_count:564
received: 592 recv_count:565
received: 592 recv_count:566
received: 592 recv_count:567
received: 592 recv_count:568
received: 592 recv_count:569
received: 592 recv_count:570
received: 592 recv_count:571
received: 592 recv_count:572
received: 592 recv_count:573
received: 592 recv_count:574
received: 592 recv_count:575
received: 592 recv_count:576
received: 592 recv_count:577
received: 592 recv_count:578
received: 592 recv_count:579
received: 592 recv_count:580
received: 592 recv_count:581
received: 592 recv_count:582
received: 592 recv_count:583
received: 592 recv_count:584
received: 592 recv_count:585
received: 592 recv_count:586
received: 592 recv_count:587
received: 592 recv_count:588
received: 592 recv_count:589
received: 592 recv_count:590
received: 592 recv_count:591
received: 592 recv_count:592
sent: 593
sent: 594
sent: 595
sent: 596
sent: 597
sent: 598
sent: 599
sent: 600
sent: 601
sent: 602
sent: 603
sent: 604
sent: 605
sent: 606
sent: 607
sent: 608
sent: 609
sent: 610
sent: 611
sent: 612
sent: 613
sent: 614
sent: 615
received: 593 recv_count:593
received: 615 recv_count:594
received: 615 recv_count:595
received: 615 recv_count:596
received: 615 recv_count:597
received: 615 recv_count:598
received: 615 recv_count:599
received: 615 recv_count:600
received: 615 recv_count:601
received: 615 recv_count:602
received: 615 recv_count:603
received: 615 recv_count:604
received: 615 recv_count:605
received: 615 recv_count:606
received: 615 recv_count:607
received: 615 recv_count:608
received: 615 recv_count:609
received: 615 recv_count:610
received: 615 recv_count:611
received: 615 recv_count:612
received: 615 recv_count:613
received: 615 recv_count:614
received: 615 recv_count:615
sent: 616
received: 616 recv_count:616
sent: 617
received: 617 recv_count:617
sent: 618
received: 618 recv_count:618
sent: 619
received: 619 recv_count:619
sent: 620
sent: 621
sent: 622
received: 620 recv_count:620
received: 622 recv_count:621
received: 622 recv_count:622
sent: 623
received: 623 recv_count:623
sent: 624
sent: 625
received: 624 recv_count:624
received: 625 recv_count:625
sent: 626
sent: 627
received: 626 recv_count:626
sent: 628
sent: 629
sent: 630
sent: 631
sent: 632
sent: 633
sent: 634
sent: 635
sent: 636
sent: 637
sent: 638
sent: 639
sent: 640
sent: 641
sent: 642
sent: 643
sent: 644
sent: 645
sent: 646
sent: 647
sent: 648
sent: 649
sent: 650
sent: 651
sent: 652
sent: 653
sent: 654
received: 654 recv_count:627
received: 654 recv_count:628
received: 654 recv_count:629
received: 654 recv_count:630
received: 654 recv_count:631
received: 654 recv_count:632
received: 654 recv_count:633
received: 654 recv_count:634
received: 654 recv_count:635
received: 654 recv_count:636
received: 654 recv_count:637
received: 654 recv_count:638
received: 654 recv_count:639
received: 654 recv_count:640
received: 654 recv_count:641
received: 654 recv_count:642
received: 654 recv_count:643
received: 654 recv_count:644
received: 654 recv_count:645
received: 654 recv_count:646
received: 654 recv_count:647
received: 654 recv_count:648
received: 654 recv_count:649
received: 654 recv_count:650
received: 654 recv_count:651
received: 654 recv_count:652
received: 654 recv_count:653
received: 654 recv_count:654
sent: 655
received: 655 recv_count:655
sent: 656
sent: 657
sent: 658
sent: 659
sent: 660
sent: 661
sent: 662
sent: 663
sent: 664
sent: 665
sent: 666
sent: 667
sent: 668
sent: 669
sent: 670
sent: 671
sent: 672
sent: 673
sent: 674
sent: 675
sent: 676
sent: 677
sent: 678
sent: 679
sent: 680
sent: 681
sent: 682
sent: 683
sent: 684
sent: 685
sent: 686
sent: 687
sent: 688
sent: 689
sent: 690
sent: 691
sent: 692
sent: 693
sent: 694
sent: 695
sent: 696
sent: 697
sent: 698
sent: 699
sent: 700
sent: 701
sent: 702
sent: 703
sent: 704
sent: 705
sent: 706
sent: 707
sent: 708
sent: 709
sent: 710
sent: 711
sent: 712
sent: 713
sent: 714
sent: 715
sent: 716
sent: 717
sent: 718
sent: 719
sent: 720
sent: 721
sent: 722
sent: 723
sent: 724
sent: 725
sent: 726
sent: 727
sent: 728
sent: 729
sent: 730
sent: 731
sent: 732
sent: 733
sent: 734
sent: 735
sent: 736
sent: 737
sent: 738
sent: 739
sent: 740
sent: 741
sent: 742
sent: 743
sent: 744
sent: 745
sent: 746
sent: 747
sent: 748
sent: 749
sent: 750
sent: 751
sent: 752
sent: 753
received: 753 recv_count:656
received: 753 recv_count:657
received: 753 recv_count:658
received: 753 recv_count:659
received: 753 recv_count:660
received: 753 recv_count:661
received: 753 recv_count:662
received: 753 recv_count:663
received: 753 recv_count:664
received: 753 recv_count:665
received: 753 recv_count:666
received: 753 recv_count:667
received: 753 recv_count:668
received: 753 recv_count:669
received: 753 recv_count:670
received: 753 recv_count:671
received: 753 recv_count:672
received: 753 recv_count:673
received: 753 recv_count:674
received: 753 recv_count:675
received: 753 recv_count:676
received: 753 recv_count:677
received: 753 recv_count:678
received: 753 recv_count:679
received: 753 recv_count:680
received: 753 recv_count:681
received: 753 recv_count:682
received: 753 recv_count:683
received: 753 recv_count:684
received: 753 recv_count:685
received: 753 recv_count:686
received: 753 recv_count:687
received: 753 recv_count:688
received: 753 recv_count:689
received: 753 recv_count:690
received: 753 recv_count:691
received: 753 recv_count:692
received: 753 recv_count:693
received: 753 recv_count:694
received: 753 recv_count:695
received: 753 recv_count:696
received: 753 recv_count:697
received: 753 recv_count:698
received: 753 recv_count:699
received: 753 recv_count:700
received: 753 recv_count:701
received: 753 recv_count:702
received: 753 recv_count:703
received: 753 recv_count:704
received: 753 recv_count:705
received: 753 recv_count:706
received: 753 recv_count:707
received: 753 recv_count:708
received: 753 recv_count:709
received: 753 recv_count:710
received: 753 recv_count:711
received: 753 recv_count:712
received: 753 recv_count:713
received: 753 recv_count:714
received: 753 recv_count:715
received: 753 recv_count:716
received: 753 recv_count:717
received: 753 recv_count:718
received: 753 recv_count:719
received: 753 recv_count:720
received: 753 recv_count:721
received: 753 recv_count:722
received: 753 recv_count:723
received: 753 recv_count:724
received: 753 recv_count:725
received: 753 recv_count:726
received: 753 recv_count:727
received: 753 recv_count:728
received: 753 recv_count:729
received: 753 recv_count:730
received: 753 recv_count:731
received: 753 recv_count:732
received: 753 recv_count:733
received: 753 recv_count:734
received: 753 recv_count:735
received: 753 recv_count:736
received: 753 recv_count:737
received: 753 recv_count:738
received: 753 recv_count:739
received: 753 recv_count:740
received: 753 recv_count:741
received: 753 recv_count:742
received: 753 recv_count:743
received: 753 recv_count:744
received: 753 recv_count:745
received: 753 recv_count:746
received: 753 recv_count:747
received: 753 recv_count:748
received: 753 recv_count:749
received: 753 recv_count:750
received: 753 recv_count:751
received: 753 recv_count:752
received: 753 recv_count:753
sent: 754
received: 754 recv_count:754
sent: 755
received: 755 recv_count:755
sent: 756
received: 756 recv_count:756
sent: 757
received: 757 recv_count:757
sent: 758
received: 758 recv_count:758
sent: 759
received: 759 recv_count:759
sent: 760
received: 760 recv_count:760
sent: 761
sent: 762
received: 761 recv_count:761
received: 762 recv_count:762
sent: 763
received: 763 recv_count:763
sent: 764
received: 764 recv_count:764
sent: 765
received: 765 recv_count:765
sent: 766
sent: 767
received: 766 recv_count:766
received: 767 recv_count:767
sent: 768
sent: 769
received: 768 recv_count:768
sent: 770
sent: 771
sent: 772
sent: 773
received: 782 recv_count:769
sent: 774
sent: 775
sent: 776
sent: 777
sent: 778
sent: 779
sent: 780
sent: 781
sent: 782
received: 782 recv_count:770
received: 782 recv_count:771
received: 782 recv_count:772
received: 782 recv_count:773
received: 782 recv_count:774
received: 782 recv_count:775
received: 782 recv_count:776
received: 782 recv_count:777
received: 782 recv_count:778
received: 782 recv_count:779
received: 782 recv_count:780
received: 782 recv_count:781
received: 782 recv_count:782
sent: 783
sent: 784
received: 783 recv_count:783
sent: 785
sent: 786
sent: 787
sent: 788
sent: 789
sent: 790
sent: 791
sent: 792
sent: 793
sent: 794
sent: 795
received: 795 recv_count:784
received: 795 recv_count:785
received: 795 recv_count:786
received: 795 recv_count:787
received: 795 recv_count:788
received: 795 recv_count:789
received: 795 recv_count:790
received: 795 recv_count:791
received: 795 recv_count:792
received: 795 recv_count:793
received: 795 recv_count:794
received: 795 recv_count:795
sent: 796
received: 796 recv_count:796
sent: 797
sent: 798
sent: 799
sent: 800
sent: 801
sent: 802
sent: 803
sent: 804
sent: 805
sent: 806
sent: 807
sent: 808
sent: 809
sent: 810
sent: 811
sent: 812
sent: 813
sent: 814
sent: 815
sent: 816
sent: 817
sent: 818
sent: 819
sent: 820
sent: 821
sent: 822
sent: 823
sent: 824
sent: 825
sent: 826
sent: 827
sent: 828
sent: 829
sent: 830
sent: 831
sent: 832
sent: 833
sent: 834
sent: 835
sent: 836
sent: 837
sent: 838
sent: 839
sent: 840
sent: 841
sent: 842
sent: 843
sent: 844
sent: 845
sent: 846
sent: 847
sent: 848
sent: 849
sent: 850
sent: 851
sent: 852
sent: 853
sent: 854
sent: 855
sent: 856
sent: 857
sent: 858
sent: 859
sent: 860
sent: 861
sent: 862
sent: 863
sent: 864
sent: 865
received: 865 recv_count:797
received: 865 recv_count:798
received: 865 recv_count:799
received: 865 recv_count:800
received: 865 recv_count:801
received: 865 recv_count:802
received: 865 recv_count:803
received: 865 recv_count:804
received: 865 recv_count:805
received: 865 recv_count:806
received: 865 recv_count:807
received: 865 recv_count:808
received: 865 recv_count:809
received: 865 recv_count:810
received: 865 recv_count:811
received: 865 recv_count:812
received: 865 recv_count:813
received: 865 recv_count:814
received: 865 recv_count:815
received: 865 recv_count:816
received: 865 recv_count:817
received: 865 recv_count:818
received: 865 recv_count:819
received: 865 recv_count:820
received: 865 recv_count:821
received: 865 recv_count:822
received: 865 recv_count:823
received: 865 recv_count:824
received: 865 recv_count:825
received: 865 recv_count:826
received: 865 recv_count:827
received: 865 recv_count:828
received: 865 recv_count:829
received: 865 recv_count:830
received: 865 recv_count:831
received: 865 recv_count:832
received: 865 recv_count:833
received: 865 recv_count:834
received: 865 recv_count:835
received: 865 recv_count:836
received: 865 recv_count:837
received: 865 recv_count:838
received: 865 recv_count:839
received: 865 recv_count:840
received: 865 recv_count:841
received: 865 recv_count:842
received: 865 recv_count:843
received: 865 recv_count:844
received: 865 recv_count:845
received: 865 recv_count:846
received: 865 recv_count:847
received: 865 recv_count:848
received: 865 recv_count:849
received: 865 recv_count:850
received: 865 recv_count:851
received: 865 recv_count:852
received: 865 recv_count:853
received: 865 recv_count:854
received: 865 recv_count:855
received: 865 recv_count:856
received: 865 recv_count:857
received: 865 recv_count:858
received: 865 recv_count:859
received: 865 recv_count:860
received: 865 recv_count:861
received: 865 recv_count:862
received: 865 recv_count:863
received: 865 recv_count:864
received: 865 recv_count:865
sent: 866
sent: 867
received: 866 recv_count:866
sent: 868
sent: 869
sent: 870
sent: 871
sent: 872
sent: 873
sent: 874
sent: 875
sent: 876
sent: 877
sent: 878
sent: 879
sent: 880
sent: 881
sent: 882
sent: 883
sent: 884
sent: 885
sent: 886
sent: 887
sent: 888
sent: 889
sent: 890
sent: 891
sent: 892
sent: 893
sent: 894
received: 894 recv_count:867
received: 894 recv_count:868
received: 894 recv_count:869
received: 894 recv_count:870
received: 894 recv_count:871
received: 894 recv_count:872
received: 894 recv_count:873
received: 894 recv_count:874
received: 894 recv_count:875
received: 894 recv_count:876
received: 894 recv_count:877
received: 894 recv_count:878
received: 894 recv_count:879
received: 894 recv_count:880
received: 894 recv_count:881
received: 894 recv_count:882
received: 894 recv_count:883
received: 894 recv_count:884
received: 894 recv_count:885
received: 894 recv_count:886
received: 894 recv_count:887
received: 894 recv_count:888
received: 894 recv_count:889
received: 894 recv_count:890
received: 894 recv_count:891
received: 894 recv_count:892
received: 894 recv_count:893
received: 894 recv_count:894
sent: 895
sent: 896
received: 895 recv_count:895
sent: 897
sent: 898
sent: 899
sent: 900
sent: 901
sent: 902
sent: 903
sent: 904
sent: 905
sent: 906
sent: 907
sent: 908
sent: 909
sent: 910
sent: 911
sent: 912
sent: 913
sent: 914
sent: 915
sent: 916
sent: 917
sent: 918
sent: 919
sent: 920
sent: 921
sent: 922
sent: 923
sent: 924
sent: 925
sent: 926
sent: 927
received: 927 recv_count:896
received: 927 recv_count:897
received: 927 recv_count:898
received: 927 recv_count:899
received: 927 recv_count:900
received: 927 recv_count:901
received: 927 recv_count:902
received: 927 recv_count:903
received: 927 recv_count:904
received: 927 recv_count:905
received: 927 recv_count:906
received: 927 recv_count:907
received: 927 recv_count:908
received: 927 recv_count:909
received: 927 recv_count:910
received: 927 recv_count:911
received: 927 recv_count:912
received: 927 recv_count:913
received: 927 recv_count:914
received: 927 recv_count:915
received: 927 recv_count:916
received: 927 recv_count:917
received: 927 recv_count:918
received: 927 recv_count:919
received: 927 recv_count:920
received: 927 recv_count:921
received: 927 recv_count:922
received: 927 recv_count:923
received: 927 recv_count:924
received: 927 recv_count:925
received: 927 recv_count:926
received: 927 recv_count:927
sent: 928
sent: 929
received: 928 recv_count:928
sent: 930
sent: 931
sent: 932
sent: 933
sent: 934
sent: 935
sent: 936
sent: 937
sent: 938
sent: 939
sent: 940
sent: 941
sent: 942
sent: 943
sent: 944
sent: 945
sent: 946
sent: 947
sent: 948
sent: 949
sent: 950
sent: 951
sent: 952
received: 952 recv_count:929
received: 952 recv_count:930
received: 952 recv_count:931
received: 952 recv_count:932
received: 952 recv_count:933
received: 952 recv_count:934
received: 952 recv_count:935
received: 952 recv_count:936
received: 952 recv_count:937
received: 952 recv_count:938
received: 952 recv_count:939
received: 952 recv_count:940
received: 952 recv_count:941
received: 952 recv_count:942
received: 952 recv_count:943
received: 952 recv_count:944
received: 952 recv_count:945
received: 952 recv_count:946
received: 952 recv_count:947
received: 952 recv_count:948
received: 952 recv_count:949
received: 952 recv_count:950
received: 952 recv_count:951
received: 952 recv_count:952
sent: 953
received: 953 recv_count:953
sent: 954
received: 954 recv_count:954
sent: 955
received: 955 recv_count:955
sent: 956
received: 956 recv_count:956
sent: 957
received: 957 recv_count:957
sent: 958
received: 958 recv_count:958
sent: 959
sent: 960
sent: 961
sent: 962
received: 959 recv_count:959
sent: 963
sent: 964
sent: 965
received: 965 recv_count:960
received: 965 recv_count:961
received: 965 recv_count:962
received: 965 recv_count:963
received: 965 recv_count:964
received: 965 recv_count:965
sent: 966
received: 966 recv_count:966
sent: 967
sent: 968
received: 967 recv_count:967
received: 968 recv_count:968
sent: 969
received: 969 recv_count:969
sent: 970
received: 970 recv_count:970
sent: 971
received: 971 recv_count:971
sent: 972
sent: 973
received: 973 recv_count:972
received: 973 recv_count:973
sent: 974
received: 974 recv_count:974
sent: 975
sent: 976
sent: 977
sent: 978
sent: 979
received: 979 recv_count:975
received: 979 recv_count:976
received: 979 recv_count:977
received: 979 recv_count:978
received: 979 recv_count:979
sent: 980
received: 980 recv_count:980
sent: 981
sent: 982
received: 981 recv_count:981
received: 982 recv_count:982
sent: 983
received: 983 recv_count:983
sent: 984
received: 984 recv_count:984
sent: 985
received: 985 recv_count:985
sent: 986
received: 986 recv_count:986
sent: 987
sent: 988
sent: 989
received: 987 recv_count:987
sent: 990
sent: 991
sent: 992
sent: 993
sent: 994
sent: 995
sent: 996
received: 996 recv_count:988
received: 996 recv_count:989
received: 996 recv_count:990
received: 996 recv_count:991
received: 996 recv_count:992
received: 996 recv_count:993
received: 996 recv_count:994
received: 996 recv_count:995
received: 996 recv_count:996
sent: 997
(lldb)
Thread 1Queue : com.apple.main-thread (serial)
#0 0x00000001000257ac in boost::asio::detail::buffer_cast_helper(boost::asio::mutable_buffer const&) at /usr/local/include/boost/asio/buffer.hpp:146
#1 0x0000000100025781 in boost::asio::const_buffer::const_buffer(boost::asio::mutable_buffer const&) at /usr/local/include/boost/asio/buffer.hpp:231
#2 0x000000010002574d in boost::asio::const_buffer::const_buffer(boost::asio::mutable_buffer const&) at /usr/local/include/boost/asio/buffer.hpp:237
#3 0x00000001000267b2 in boost::enable_if<boost::has_range_const_iterator<boost::asio::mutable_buffers_1>, unsigned long>::type azmq::detail::socket_ops::send<boost::asio::mutable_buffers_1>(boost::asio::mutable_buffers_1 const&, std::__1::unique_ptr<void, azmq::detail::socket_ops::socket_close>&, int, boost::system::error_code&) at /usr/local/include/azmq/detail/socket_ops.hpp:270
#4 0x000000010002661d in azmq::detail::send_buffer_op_base<boost::asio::mutable_buffers_1>::do_perform(azmq::detail::reactor_op*, std::__1::unique_ptr<void, azmq::detail::socket_ops::socket_close>&) at /usr/local/include/azmq/detail/send_op.hpp:38
#5 0x000000010001d50c in azmq::detail::reactor_op::do_perform(std::__1::unique_ptr<void, azmq::detail::socket_ops::socket_close>&) at /usr/local/include/azmq/detail/reactor_op.hpp:29
#6 0x000000010001eabc in azmq::detail::socket_service::per_descriptor_data::perform_ops(boost::intrusive::list<azmq::detail::reactor_op, boost::intrusive::member_hook<azmq::detail::reactor_op, boost::intrusive::list_member_hook<void, void, void>, &(azmq::detail::reactor_op::member_hook_)>, void, void, void>&, boost::system::error_code&) at /usr/local/include/azmq/detail/socket_service.hpp:118
#7 0x000000010001e894 in azmq::detail::socket_service::handle_missed_events(std::__1::weak_ptr<azmq::detail::socket_service::per_descriptor_data> const&, boost::system::error_code) at /usr/local/include/azmq/detail/socket_service.hpp:520
#8 0x000000010001e7bc in azmq::detail::socket_service::check_missed_events(std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&)::'lambda'()::operator()() const at /usr/local/include/azmq/detail/socket_service.hpp:540
#9 0x000000010001e779 in void boost::asio::asio_handler_invoke<azmq::detail::socket_service::check_missed_events(std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&)::'lambda'()>(azmq::detail::socket_service::check_missed_events(std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&)::'lambda'()&, ...) at /usr/local/include/boost/asio/handler_invoke_hook.hpp:69
#10 0x000000010001e647 in void boost_asio_handler_invoke_helpers::invoke<azmq::detail::socket_service::check_missed_events(std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&)::'lambda'(), azmq::detail::socket_service::check_missed_events(std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&)::'lambda'()>(azmq::detail::socket_service::check_missed_events(std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&)::'lambda'()&, azmq::detail::socket_service::check_missed_events(std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&)::'lambda'()&) at /usr/local/include/boost/asio/detail/handler_invoke_helpers.hpp:37
#11 0x000000010001e4f7 in boost::asio::detail::completion_handler<azmq::detail::socket_service::check_missed_events(std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&)::'lambda'()>::do_complete(boost::asio::detail::task_io_service*, boost::asio::detail::task_io_service_operation*, boost::system::error_code const&, unsigned long) at /usr/local/include/boost/asio/detail/completion_handler.hpp:68
#12 0x000000010002a847 in boost::asio::detail::task_io_service_operation::complete(boost::asio::detail::task_io_service&, boost::system::error_code const&, unsigned long) at /usr/local/include/boost/asio/detail/task_io_service_operation.hpp:38
#13 0x0000000100029ec6 in boost::asio::detail::task_io_service::do_run_one(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&, boost::asio::detail::task_io_service_thread_info&, boost::system::error_code const&) at /usr/local/include/boost/asio/detail/impl/task_io_service.ipp:372
#14 0x0000000100029aed in boost::asio::detail::task_io_service::run(boost::system::error_code&) at /usr/local/include/boost/asio/detail/impl/task_io_service.ipp:149
#15 0x0000000100009af1 in boost::asio::io_service::run() at /usr/local/include/boost/asio/impl/io_service.ipp:59
#16 0x0000000100006c1c in main at /Users/athundt/source/robonetracker/modules/grl/test/AzmqTest.cpp:138
#17 0x00007fff8f2055c9 in start ()
Thread 2Thread 3
Thread 1Queue : com.apple.main-thread (serial)
#0 0x00007fff8e1dc1b0 in _platform_memmove$VARIANT$Unknown ()
#1 0x000000010005e3bb in boost::asio::buffer_copy(boost::asio::mutable_buffer const&, boost::asio::const_buffer const&) at /usr/local/include/boost/asio/buffer.hpp:1303
#2 0x000000010005e338 in boost::asio::buffer_copy(boost::asio::mutable_buffers_1 const&, boost::asio::const_buffer const&) at /usr/local/include/boost/asio/buffer.hpp:1446
#3 0x000000010005dfd9 in azmq::v1::message::rebuild(boost::asio::const_buffer const&) at /usr/local/include/azmq/detail/../message.hpp:172
#4 0x000000010005dd17 in boost::enable_if<boost::has_range_const_iterator<boost::asio::mutable_buffers_1>, unsigned long>::type azmq::detail::socket_ops::send<boost::asio::mutable_buffers_1>(boost::asio::mutable_buffers_1 const&, std::__1::unique_ptr<void, azmq::detail::socket_ops::socket_close>&, int, boost::system::error_code&) at /usr/local/include/azmq/detail/socket_ops.hpp:268
#5 0x000000010005da7d in azmq::detail::send_buffer_op_base<boost::asio::mutable_buffers_1>::do_perform(azmq::detail::reactor_op*, std::__1::unique_ptr<void, azmq::detail::socket_ops::socket_close>&) at /usr/local/include/azmq/detail/send_op.hpp:38
#6 0x000000010005739c in azmq::detail::reactor_op::do_perform(std::__1::unique_ptr<void, azmq::detail::socket_ops::socket_close>&) at /usr/local/include/azmq/detail/reactor_op.hpp:29
#7 0x00000001000592d3 in azmq::detail::socket_service::per_descriptor_data::perform_ops(int, boost::intrusive::list<azmq::detail::reactor_op, boost::intrusive::member_hook<azmq::detail::reactor_op, boost::intrusive::list_member_hook<void, void, void>, &(azmq::detail::reactor_op::member_hook_)>, void, void, void>&) at /usr/local/include/azmq/detail/socket_service.hpp:106
#8 0x0000000100059053 in azmq::detail::socket_service::reactor_handler::operator()(boost::system::error_code const&, unsigned long) const at /usr/local/include/azmq/detail/socket_service.hpp:534
#9 0x000000010005ad8b in azmq::detail::socket_service::reactor_handler::schedule(azmq::detail::socket_service::descriptor_map&, std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&, bool)::'lambda'()::operator()() const at /usr/local/include/azmq/detail/socket_service.hpp:555
#10 0x000000010005ad49 in void boost::asio::asio_handler_invoke<azmq::detail::socket_service::reactor_handler::schedule(azmq::detail::socket_service::descriptor_map&, std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&, bool)::'lambda'()>(azmq::detail::socket_service::reactor_handler::schedule(azmq::detail::socket_service::descriptor_map&, std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&, bool)::'lambda'()&, ...) at /usr/local/include/boost/asio/handler_invoke_hook.hpp:69
#11 0x000000010005ac17 in void boost_asio_handler_invoke_helpers::invoke<azmq::detail::socket_service::reactor_handler::schedule(azmq::detail::socket_service::descriptor_map&, std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&, bool)::'lambda'(), azmq::detail::socket_service::reactor_handler::schedule(azmq::detail::socket_service::descriptor_map&, std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&, bool)::'lambda'()>(azmq::detail::socket_service::reactor_handler::schedule(azmq::detail::socket_service::descriptor_map&, std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&, bool)::'lambda'()&, azmq::detail::socket_service::reactor_handler::schedule(azmq::detail::socket_service::descriptor_map&, std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&, bool)::'lambda'()&) at /usr/local/include/boost/asio/detail/handler_invoke_helpers.hpp:37
#12 0x000000010005aaea in boost::asio::detail::completion_handler<azmq::detail::socket_service::reactor_handler::schedule(azmq::detail::socket_service::descriptor_map&, std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&, bool)::'lambda'()>::do_complete(boost::asio::detail::task_io_service*, boost::asio::detail::task_io_service_operation*, boost::system::error_code const&, unsigned long) at /usr/local/include/boost/asio/detail/completion_handler.hpp:68
#13 0x00000001000102f7 in boost::asio::detail::task_io_service_operation::complete(boost::asio::detail::task_io_service&, boost::system::error_code const&, unsigned long) at /usr/local/include/boost/asio/detail/task_io_service_operation.hpp:38
#14 0x0000000100021cf6 in boost::asio::detail::task_io_service::do_run_one(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&, boost::asio::detail::task_io_service_thread_info&, boost::system::error_code const&) at /usr/local/include/boost/asio/detail/impl/task_io_service.ipp:372
#15 0x000000010002191d in boost::asio::detail::task_io_service::run(boost::system::error_code&) at /usr/local/include/boost/asio/detail/impl/task_io_service.ipp:149
#16 0x0000000100006891 in boost::asio::io_service::run() at /usr/local/include/boost/asio/impl/io_service.ipp:59
#17 0x0000000100004392 in main at /Users/athundt/source/robone/src/AzmqFlatbufferTest.cpp:101
#18 0x00007fff8a22f5c9 in start ()
#19 0x00007fff8a22f5c9 in start ()
Thread 4#0 0x00007fff8e7ad166 in __psynch_mutexwait ()
#1 0x00007fff8bbcf78a in _pthread_mutex_lock ()
#2 0x00000001000186cd in boost::posix::pthread_mutex_lock(_opaque_pthread_mutex_t*) [inlined] at /usr/local/include/boost/thread/pthread/mutex.hpp:62
#3 0x00000001000186c4 in boost::mutex::lock() at /usr/local/include/boost/thread/pthread/mutex.hpp:116
#4 0x0000000100024174 in azmq::detail::socket_service::per_descriptor_data::lock() const at /usr/local/include/azmq/detail/socket_service.hpp:157
#5 0x0000000100024123 in boost::unique_lock<azmq::detail::socket_service::per_descriptor_data>::lock() at /usr/local/include/boost/thread/lock_types.hpp:346
#6 0x0000000100024037 in boost::unique_lock<azmq::detail::socket_service::per_descriptor_data>::unique_lock(azmq::detail::socket_service::per_descriptor_data&) at /usr/local/include/boost/thread/lock_types.hpp:124
#7 0x000000010002347d in boost::unique_lock<azmq::detail::socket_service::per_descriptor_data>::unique_lock(azmq::detail::socket_service::per_descriptor_data&) at /usr/local/include/boost/thread/lock_types.hpp:125
#8 0x0000000100056a41 in azmq::detail::socket_service::enqueue(std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&, azmq::detail::socket_service::op_type, std::__1::unique_ptr<azmq::detail::reactor_op, std::__1::default_delete<azmq::detail::reactor_op> >&) at /usr/local/include/azmq/detail/socket_service.hpp:589
#9 0x0000000100056601 in void azmq::detail::socket_service::enqueue<azmq::detail::send_buffer_op<boost::asio::mutable_buffers_1, AzmqFlatbuffer::async_send_flatbuffer(std::__1::shared_ptr<flatbuffers::FlatBufferBuilder>)::'lambda'(boost::system::error_code const&, unsigned long)>, boost::asio::mutable_buffers_1 const&, AzmqFlatbuffer::async_send_flatbuffer(std::__1::shared_ptr<flatbuffers::FlatBufferBuilder>)::'lambda'(boost::system::error_code const&, unsigned long), int&>(std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&, azmq::detail::socket_service::op_type, boost::asio::mutable_buffers_1 const&&&, AzmqFlatbuffer::async_send_flatbuffer(std::__1::shared_ptr<flatbuffers::FlatBufferBuilder>)::'lambda'(boost::system::error_code const&, unsigned long)&&, int&&&) at /usr/local/include/azmq/detail/socket_service.hpp:433
#10 0x0000000100056213 in void azmq::v1::socket::async_send<boost::asio::mutable_buffers_1, AzmqFlatbuffer::async_send_flatbuffer(std::__1::shared_ptr<flatbuffers::FlatBufferBuilder>)::'lambda'(boost::system::error_code const&, unsigned long)>(boost::asio::mutable_buffers_1 const&, AzmqFlatbuffer::async_send_flatbuffer(std::__1::shared_ptr<flatbuffers::FlatBufferBuilder>)::'lambda'(boost::system::error_code const&, unsigned long), int) at /usr/local/include/azmq/socket.hpp:584
#11 0x0000000100005da9 in AzmqFlatbuffer::async_send_flatbuffer(std::__1::shared_ptr<flatbuffers::FlatBufferBuilder>) at /Users/athundt/source/robone/include/robone/AzmqFlatbuffer.hpp:81
#12 0x0000000100003b13 in bounce(std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer>) at /Users/athundt/source/robone/src/AzmqFlatbufferTest.cpp:33
#13 0x0000000100007ba7 in decltype(std::__1::forward<void (*)(std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer>)>(fp)(std::__1::forward<std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer> >(fp0))) std::__1::__invoke<void (*)(std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer>), std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer> >(void (*&&)(std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer>), std::__1::shared_ptr<AzmqFlatbuffer>&&, std::__1::shared_ptr<AzmqFlatbuffer>&&) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base:413
#14 0x0000000100007aa1 in void std::__1::__thread_execute<void (*)(std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer>), std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer>, 1ul, 2ul>(std::__1::tuple<void (*)(std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer>), std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer> >&, std::__1::__tuple_indices<1ul, 2ul>) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread:332
#15 0x0000000100007a55 in void* std::__1::__thread_proxy<std::__1::tuple<void (*)(std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer>), std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer> > >(void*) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread:342
#16 0x00007fff8bbd1268 in _pthread_body ()
#17 0x00007fff8bbd11e5 in _pthread_start ()
#18 0x00007fff8bbcf41d in thread_start ()
Stack trace run with https://github.com/zeromq/azmq/commit/d1f609df59ce7d7c9120326760f48365346e37c0
Thread 1Queue : com.apple.main-thread (serial)
#0 0x00007fff943c01b0 in _platform_memmove$VARIANT$Unknown ()
#1 0x00000001000638fb in boost::asio::buffer_copy(boost::asio::mutable_buffer const&, boost::asio::const_buffer const&) at /usr/local/include/boost/asio/buffer.hpp:1303
#2 0x0000000100063878 in boost::asio::buffer_copy(boost::asio::mutable_buffers_1 const&, boost::asio::const_buffer const&) at /usr/local/include/boost/asio/buffer.hpp:1446
#3 0x0000000100063519 in azmq::message::rebuild(boost::asio::const_buffer const&) at /usr/local/include/azmq/message.hpp:176
#4 0x0000000100063257 in boost::enable_if<boost::has_range_const_iterator<boost::asio::mutable_buffers_1>, unsigned long>::type azmq::detail::socket_ops::send<boost::asio::mutable_buffers_1>(boost::asio::mutable_buffers_1 const&, std::__1::unique_ptr<void, azmq::detail::socket_ops::socket_close>&, int, boost::system::error_code&) at /usr/local/include/azmq/detail/socket_ops.hpp:270
#5 0x0000000100062fbd in azmq::detail::send_buffer_op_base<boost::asio::mutable_buffers_1>::do_perform(azmq::detail::reactor_op*, std::__1::unique_ptr<void, azmq::detail::socket_ops::socket_close>&) at /usr/local/include/azmq/detail/send_op.hpp:38
#6 0x000000010005c86c in azmq::detail::reactor_op::do_perform(std::__1::unique_ptr<void, azmq::detail::socket_ops::socket_close>&) at /usr/local/include/azmq/detail/reactor_op.hpp:29
#7 0x000000010005dc4c in azmq::detail::socket_service::per_descriptor_data::perform_ops(boost::intrusive::list<azmq::detail::reactor_op, boost::intrusive::member_hook<azmq::detail::reactor_op, boost::intrusive::list_member_hook<void, void, void>, &(azmq::detail::reactor_op::member_hook_)>, void, void, void>&, boost::system::error_code&) at /usr/local/include/azmq/detail/socket_service.hpp:118
#8 0x000000010005da24 in azmq::detail::socket_service::handle_missed_events(std::__1::weak_ptr<azmq::detail::socket_service::per_descriptor_data> const&, boost::system::error_code) at /usr/local/include/azmq/detail/socket_service.hpp:520
#9 0x000000010005d94c in azmq::detail::socket_service::check_missed_events(std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&)::'lambda'()::operator()() const at /usr/local/include/azmq/detail/socket_service.hpp:540
#10 0x000000010005d909 in void boost::asio::asio_handler_invoke<azmq::detail::socket_service::check_missed_events(std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&)::'lambda'()>(azmq::detail::socket_service::check_missed_events(std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&)::'lambda'()&, ...) at /usr/local/include/boost/asio/handler_invoke_hook.hpp:69
#11 0x000000010005d7d7 in void boost_asio_handler_invoke_helpers::invoke<azmq::detail::socket_service::check_missed_events(std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&)::'lambda'(), azmq::detail::socket_service::check_missed_events(std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&)::'lambda'()>(azmq::detail::socket_service::check_missed_events(std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&)::'lambda'()&, azmq::detail::socket_service::check_missed_events(std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&)::'lambda'()&) at /usr/local/include/boost/asio/detail/handler_invoke_helpers.hpp:37
#12 0x000000010005d687 in boost::asio::detail::completion_handler<azmq::detail::socket_service::check_missed_events(std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&)::'lambda'()>::do_complete(boost::asio::detail::task_io_service*, boost::asio::detail::task_io_service_operation*, boost::system::error_code const&, unsigned long) at /usr/local/include/boost/asio/detail/completion_handler.hpp:68
#13 0x00000001000171e7 in boost::asio::detail::task_io_service_operation::complete(boost::asio::detail::task_io_service&, boost::system::error_code const&, unsigned long) at /usr/local/include/boost/asio/detail/task_io_service_operation.hpp:38
#14 0x00000001000263d6 in boost::asio::detail::task_io_service::do_run_one(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&, boost::asio::detail::task_io_service_thread_info&, boost::system::error_code const&) at /usr/local/include/boost/asio/detail/impl/task_io_service.ipp:372
#15 0x0000000100025ffd in boost::asio::detail::task_io_service::run(boost::system::error_code&) at /usr/local/include/boost/asio/detail/impl/task_io_service.ipp:149
#16 0x0000000100009701 in boost::asio::io_service::run() at /usr/local/include/boost/asio/impl/io_service.ipp:59
#17 0x0000000100006bec in main at /Users/athundt/source/robonetracker/modules/grl/test/AzmqFlatbufferTest.cpp:137
#18 0x00007fff8f2055c9 in start ()
#19 0x00007fff8f2055c9 in start ()
Thread 2#0 0x00007fff9254d21a in kevent ()
#1 0x00000001005858ae in zmq::kqueue_t::loop() ()
#2 0x000000010059f8d5 in thread_routine(void*) ()
#3 0x00007fff910e4268 in _pthread_body ()
#4 0x00007fff910e41e5 in _pthread_start ()
#5 0x00007fff910e241d in thread_start ()
Thread 3#0 0x00007fff9254d21a in kevent ()
#1 0x00000001005858ae in zmq::kqueue_t::loop() ()
#2 0x000000010059f8d5 in thread_routine(void*) ()
#3 0x00007fff910e4268 in _pthread_body ()
#4 0x00007fff910e41e5 in _pthread_start ()
#5 0x00007fff910e241d in thread_start ()
Thread 4#0 0x00007fff9254c166 in __psynch_mutexwait ()
#1 0x00007fff910e278a in _pthread_mutex_lock ()
#2 0x000000010000d28d in boost::posix::pthread_mutex_lock(_opaque_pthread_mutex_t*) [inlined] at /usr/local/include/boost/thread/pthread/mutex.hpp:62
#3 0x000000010000d284 in boost::mutex::lock() at /usr/local/include/boost/thread/pthread/mutex.hpp:116
#4 0x000000010000d264 in azmq::detail::socket_service::per_descriptor_data::lock() const at /usr/local/include/azmq/detail/socket_service.hpp:169
#5 0x000000010000d0f3 in boost::unique_lock<azmq::detail::socket_service::per_descriptor_data>::lock() at /usr/local/include/boost/thread/lock_types.hpp:346
#6 0x000000010000d007 in boost::unique_lock<azmq::detail::socket_service::per_descriptor_data>::unique_lock(azmq::detail::socket_service::per_descriptor_data&) at /usr/local/include/boost/thread/lock_types.hpp:124
#7 0x000000010000cded in boost::unique_lock<azmq::detail::socket_service::per_descriptor_data>::unique_lock(azmq::detail::socket_service::per_descriptor_data&) at /usr/local/include/boost/thread/lock_types.hpp:125
#8 0x000000010005bf81 in azmq::detail::socket_service::enqueue(std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&, azmq::detail::socket_service::op_type, std::__1::unique_ptr<azmq::detail::reactor_op, std::__1::default_delete<azmq::detail::reactor_op> >&) at /usr/local/include/azmq/detail/socket_service.hpp:649
#9 0x000000010005bb31 in void azmq::detail::socket_service::enqueue<azmq::detail::send_buffer_op<boost::asio::mutable_buffers_1, AzmqFlatbuffer::async_send_flatbuffer(std::__1::shared_ptr<flatbuffers::FlatBufferBuilder>)::'lambda'(boost::system::error_code const&, unsigned long)>, boost::asio::mutable_buffers_1 const&, AzmqFlatbuffer::async_send_flatbuffer(std::__1::shared_ptr<flatbuffers::FlatBufferBuilder>)::'lambda'(boost::system::error_code const&, unsigned long), int&>(std::__1::shared_ptr<azmq::detail::socket_service::per_descriptor_data>&, azmq::detail::socket_service::op_type, boost::asio::mutable_buffers_1 const&&&, AzmqFlatbuffer::async_send_flatbuffer(std::__1::shared_ptr<flatbuffers::FlatBufferBuilder>)::'lambda'(boost::system::error_code const&, unsigned long)&&, int&&&) at /usr/local/include/azmq/detail/socket_service.hpp:457
#10 0x000000010005b746 in void azmq::socket::async_send<boost::asio::mutable_buffers_1, AzmqFlatbuffer::async_send_flatbuffer(std::__1::shared_ptr<flatbuffers::FlatBufferBuilder>)::'lambda'(boost::system::error_code const&, unsigned long)>(boost::asio::mutable_buffers_1 const&, AzmqFlatbuffer::async_send_flatbuffer(std::__1::shared_ptr<flatbuffers::FlatBufferBuilder>)::'lambda'(boost::system::error_code const&, unsigned long)&&, int) at /usr/local/include/azmq/socket.hpp:585
#11 0x0000000100008619 in AzmqFlatbuffer::async_send_flatbuffer(std::__1::shared_ptr<flatbuffers::FlatBufferBuilder>) at /Users/athundt/source/robonetracker/modules/grl/include/grl/AzmqFlatbuffer.hpp:76
#12 0x0000000100003b0a in bounce(std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer>, bool) at /Users/athundt/source/robonetracker/modules/grl/test/AzmqFlatbufferTest.cpp:36
#13 0x000000010000aa77 in decltype(std::__1::forward<void (*)(std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer>, bool)>(fp)(std::__1::forward<std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer>, bool>(fp0))) std::__1::__invoke<void (*)(std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer>, bool), std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer>, bool>(void (*&&)(std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer>, bool), std::__1::shared_ptr<AzmqFlatbuffer>&&, std::__1::shared_ptr<AzmqFlatbuffer>&&, bool&&) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base:413
#14 0x000000010000a958 in void std::__1::__thread_execute<void (*)(std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer>, bool), std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer>, bool, 1ul, 2ul, 3ul>(std::__1::tuple<void (*)(std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer>, bool), std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer>, bool>&, std::__1::__tuple_indices<1ul, 2ul, 3ul>) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread:332
#15 0x000000010000a8d0 in void* std::__1::__thread_proxy<std::__1::tuple<void (*)(std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer>, bool), std::__1::shared_ptr<AzmqFlatbuffer>, std::__1::shared_ptr<AzmqFlatbuffer>, bool> >(void*) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread:342
#16 0x00007fff910e4268 in _pthread_body ()
#17 0x00007fff910e41e5 in _pthread_start ()
#18 0x00007fff910e241d in thread_start ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment