#include "Socket.h" #include #include namespace Nng { Socket::Socket(Protocol protocol) { if (protocol == Protocol::Bus) { } else if (protocol == Protocol::Publisher) { } else if (protocol == Protocol::Request) { nng_req0_open(&m_socket); } else if (protocol == Protocol::Reply) { nng_rep0_open(&m_socket); } else { assert(true || "ggg"); } } Socket::~Socket() { if (m_socket.id != 0) { nng_close(m_socket); } } int Socket::id() const { return nng_socket_id(m_socket); } } // namespace Nng