Changeset 15 in flair-src for trunk/lib/FlairCore/src/UdtSocket.h
- Timestamp:
- 04/08/16 15:40:57 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/UdtSocket.h
r2 r15 18 18 #include <ConnectedSocket.h> 19 19 20 namespace flair 21 { 22 namespace core 23 { 24 /*! \class UdtSocket 25 * 26 * \brief Class encapsulating a UDT socket 27 * 28 */ 29 class UdtSocket:public ConnectedSocket { 30 public: 31 UdtSocket(const Object* parent,const std::string name,bool blockOnSend=false,bool blockOnReceive=true); 32 ~UdtSocket(); 33 void Listen(const unsigned int port,const std::string localAddress="ANY"); 34 UdtSocket *Accept(Time timeout); //should throw an exception if not a listening socket 35 bool Connect(const unsigned int port,const std::string distantAddress,Time timeout); // /!\ timeout is ignored 36 ssize_t SendMessage(const char* message,size_t message_len,Time timeout); 37 ssize_t RecvMessage(char* buf,size_t buf_len,Time timeout); 20 namespace flair { 21 namespace core { 22 /*! \class UdtSocket 23 * 24 * \brief Class encapsulating a UDT socket 25 * 26 */ 27 class UdtSocket : public ConnectedSocket { 28 public: 29 UdtSocket(const Object *parent, const std::string name, 30 bool blockOnSend = false, bool blockOnReceive = true); 31 ~UdtSocket(); 32 void Listen(const unsigned int port, const std::string localAddress = "ANY"); 33 UdtSocket * 34 Accept(Time timeout); // should throw an exception if not a listening socket 35 bool Connect(const unsigned int port, const std::string distantAddress, 36 Time timeout); // /!\ timeout is ignored 37 ssize_t SendMessage(const char *message, size_t message_len, Time timeout); 38 ssize_t RecvMessage(char *buf, size_t buf_len, Time timeout); 38 39 39 40 41 42 40 uint16_t NetworkToHost16(uint16_t data); 41 uint16_t HostToNetwork16(uint16_t data); 42 uint32_t NetworkToHost32(uint32_t data); 43 uint32_t HostToNetwork32(uint32_t data); 43 44 44 45 46 47 48 45 private: 46 UDTSOCKET socket; 47 bool blockOnSend; 48 bool blockOnReceive; 49 }; 49 50 50 51 } // end namespace core
Note:
See TracChangeset
for help on using the changeset viewer.