00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KSG_SENSORSOCKETAGENT_H
00022 #define KSG_SENSORSOCKETAGENT_H
00023
00024 #include <tqptrlist.h>
00025 #include <kbufferedsocket.h>
00026
00027 #include <SensorAgent.h>
00028
00029 class TQString;
00030
00031 namespace KSGRD {
00032
00033 class SensorClient;
00034
00042 class SensorSocketAgent : public SensorAgent
00043 {
00044 Q_OBJECT
00045
00046 public:
00047 SensorSocketAgent( SensorManager *sm );
00048 ~SensorSocketAgent();
00049
00050 bool start( const TQString &host, const TQString &shell,
00051 const TQString &command = "", int port = -1 );
00052
00053 void hostInfo( TQString &shell, TQString &command, int &port ) const;
00054
00055 private slots:
00056 void connectionClosed();
00057 void msgSent( int );
00058 void msgRcvd();
00059 void error( int );
00060
00061 private:
00062 bool writeMsg( const char *msg, int len );
00063 bool txReady();
00064
00065 KNetwork::KBufferedSocket mSocket;
00066 int mPort;
00067 };
00068
00069 }
00070
00071 #endif