24 #ifndef _KMESSAGEIO_H_ 25 #define _KMESSAGEIO_H_ 27 #include <tqcstring.h> 28 #include <tqhostaddress.h> 31 #include <tqptrqueue.h> 65 KMessageIO (TQObject *parent = 0,
const char *name = 0);
75 virtual int rtti()
const {
return 0;}
83 kdError(11001) <<
"Calling PURE virtual isNetwork...BAD" << endl;
97 kdError(11001) <<
"Calling PURE virtual isConencted...BAD" << endl;
109 void setId (TQ_UINT32
id);
126 virtual TQString
peerName ()
const {
return TQString::fromLatin1(
"localhost"); }
135 void received (
const TQByteArray &msg);
158 virtual void send (
const TQByteArray &msg) = 0;
186 KMessageSocket (TQString host, TQ_UINT16 port, TQObject *parent = 0,
187 const char *name = 0);
197 KMessageSocket (TQHostAddress host, TQ_UINT16 port, TQObject *parent = 0,
198 const char *name = 0);
211 KMessageSocket (TQSocket *socket, TQObject *parent = 0,
const char *name = 0);
224 KMessageSocket (
int socketFD, TQObject *parent = 0,
const char *name = 0);
234 virtual int rtti()
const {
return 1;}
240 virtual TQ_UINT16
peerPort ()
const;
264 void send (
const TQByteArray &msg);
267 virtual void processNewData ();
272 bool mAwaitingHeader;
273 TQ_UINT32 mNextBlockLength;
321 virtual int rtti()
const {
return 2;}
345 void send (
const TQByteArray &msg);
357 KMessageProcess(TQObject *parent, TQString file);
360 void send (
const TQByteArray &msg);
361 void writeToProcess();
371 virtual int rtti()
const {
return 3;}
376 void slotReceivedStdout(TDEProcess *proc,
char *buffer,
int buflen);
377 void slotReceivedStderr(TDEProcess *proc,
char *buffer,
int buflen);
378 void slotProcessExited(TDEProcess *p);
379 void slotWroteStdin(TDEProcess *p);
382 TQString mProcessName;
383 TDEProcess *mProcess;
384 TQPtrQueue <TQByteArray> mQueue;
385 TQByteArray *mSendBuffer;
386 TQByteArray mReceiveBuffer;
387 unsigned int mReceiveCount;
396 KMessageFilePipe(TQObject *parent,TQFile *readFile,TQFile *writeFile);
399 void send (
const TQByteArray &msg);
410 virtual int rtti()
const {
return 4;}
417 TQByteArray mReceiveBuffer;
418 unsigned int mReceiveCount;
~KMessageIO()
The usual destructor, does nothing special.
virtual void send(const TQByteArray &msg)=0
This slot sends the data block in /e msg to the connected object, that will emit /e received()...
This class implements the message communication using a TCP/IP socket.
virtual int rtti() const
The runtime idendifcation.
void received(const TQByteArray &msg)
This signal is emitted when /e send() on the connected KMessageIO object is called.
virtual bool isConnected() const
This method returns the status of the object, whether it is already (or still) connected to another K...
virtual TQString peerName() const
This class implements the message communication using function calls directly.
virtual TQ_UINT16 peerPort() const
This abstract base class represents one end of a message connections between two clients.
void setId(TQ_UINT32 id)
Sets the ID number of this object.
KMessageIO(TQObject *parent=0, const char *name=0)
The usual TQObject constructor, does nothing else.
void connectionBroken()
This signal is emitted when the connection is closed.
virtual bool isNetwork() const
virtual int rtti() const
The runtime idendifcation.
virtual int rtti() const
The runtime idendifcation.
TQ_UINT32 id()
Queries the ID of this object.