/* * Socket.h * * Created on: Dec 5, 2012 * Author: dklein */ #ifndef SOCKET_H_ #define SOCKET_H_ #include #include #include "Context.h" #include "Message.h" namespace Highway { class Socket { private: zmq::socket_t* fSocket; std::string fId; long unsigned int fBytesTx; long unsigned int fBytesRx; long unsigned int fMessagesTx; long unsigned int fMessagesRx; public: const static std::string TCP, IPC, INPROC; Socket(Context* context, int type, int num); virtual ~Socket(); std::string GetId(); static std::string GetTypeString(int type); bool Send(Message* msg); bool Receive(Message* msg); void Close(); bool Bind(std::string address); bool Connect(std::string address); zmq::socket_t* GetSocket(); long unsigned int GetBytesTx(); long unsigned int GetBytesRx(); long unsigned int GetMessagesTx(); long unsigned int GetMessagesRx(); }; } /* namespace Highway */ #endif /* SOCKET_H_ */