libkdegames/kggznet
kggzpacket.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 #ifndef KGGZPACKET_H
00022 #define KGGZPACKET_H
00023
00024 #include <QtCore/QObject>
00025 #include <QtCore/QDataStream>
00026
00027 #include "kggznet_export.h"
00028
00029 class QAbstractSocket;
00030
00054 class KGGZNET_EXPORT KGGZPacket : public QObject
00055 {
00056 Q_OBJECT
00057 public:
00064 KGGZPacket();
00065
00072 ~KGGZPacket();
00073
00083 QDataStream *inputstream();
00084
00093 QDataStream *outputstream();
00094
00101 void flush();
00102
00103 public Q_SLOTS:
00113 void slotNetwork(int fd);
00114
00115 Q_SIGNALS:
00122 void signalPacket();
00123
00130 void signalError();
00131
00132 private Q_SLOTS:
00133 void slotSocketError();
00134
00135 private:
00136 void errorhandler();
00137 void readchunk();
00138
00139 QDataStream *m_inputstream, *m_outputstream;
00140 QAbstractSocket *m_socket;
00141 QByteArray m_input, m_output;
00142 int m_size;
00143 };
00144
00145 #endif
00146