UdpConnection.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef PROTOCOLS__TRANSPORTS__UDP_CONNECTION_H
00024 #define PROTOCOLS__TRANSPORTS__UDP_CONNECTION_H
00025
00026 #include "Connection.h"
00027
00028 namespace Protocols {
00029 namespace Transports {
00030
00031 class UdpSwitch;
00032 class UdpConnectionPrivate;
00033
00035
00079 class UdpConnection : public Connection
00080 {
00081 Q_OBJECT
00082 REFERENCE_OBJECT (UdpConnection)
00083
00084 public:
00085 UdpConnection (UdpSwitch *udpSwitch);
00086 ~UdpConnection();
00087
00088 protected:
00089 void doConnectToNode (const NodeAddress &);
00090 void doDisconnectFromNode();
00091 qint64 readData (char * data, qint64 maxSize);
00092 qint64 writeData (const char * data, qint64 maxSize);
00093
00094 private:
00095 void datagramRead (const QByteArray &datagram);
00096 void datagramWritten();
00097
00098 private:
00099 auto_ptr <UdpConnectionPrivate> p;
00100
00101 friend class UdpSwitch;
00102 };
00103
00104 }
00105 }
00106
00107 #endif // PROTOCOLS__TRANSPORTS__UDP_CONNECTION_H