00001 #ifndef UDPCONVERGENCELAYER_H_ 00002 #define UDPCONVERGENCELAYER_H_ 00003 00004 #include "ConvergenceLayer.h" 00005 #include "utils/Service.h" 00006 #include "utils/MutexLock.h" 00007 #include "utils/Mutex.h" 00008 00009 using namespace dtn::data; 00010 using namespace dtn::utils; 00011 00012 namespace dtn 00013 { 00014 namespace core 00015 { 00020 class UDPConvergenceLayer : public Service, public ConvergenceLayer 00021 { 00022 public: 00030 UDPConvergenceLayer(string bind_addr, unsigned short port, bool broadcast = false, unsigned int mtu = 1280); 00031 00035 virtual ~UDPConvergenceLayer(); 00036 00040 virtual TransmitReport transmit(const Bundle &b); 00041 00045 virtual TransmitReport transmit(const Bundle &b, const Node &node); 00046 00050 virtual void tick(); 00051 00052 private: 00056 void receiveBundle(); 00057 00058 int m_socket; 00059 00060 //static const int MAX_SIZE; 00061 static const int DEFAULT_PORT; 00062 00063 unsigned int m_maxmsgsize; 00064 00065 string m_selfaddr; 00066 unsigned int m_selfport; 00067 00068 Mutex m_writelock; 00069 00070 //int m_fakeloss; 00071 }; 00072 } 00073 } 00074 00075 #endif /*UDPCONVERGENCELAYER_H_*/
1.5.6