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"); }
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;
This class implements the message communication using function calls directly.
~KMessageDirect()
Destructor, closes the connection.
void send(const TQByteArray &msg)
Overwritten slot method from KMessageIO.
virtual int rtti() const
The runtime idendifcation.
bool isConnected() const
Returns true, if the object is connected to another instance.
KMessageDirect(KMessageDirect *partner=0, TQObject *parent=0, const char *name=0)
Creates an object and connects it to the object given in the first parameter.
This abstract base class represents one end of a message connections between two clients.
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().
virtual int rtti() const
The runtime idendifcation.
KMessageIO(TQObject *parent=0, const char *name=0)
The usual TQObject constructor, does nothing else.
virtual TQString peerName() const
virtual TQ_UINT16 peerPort() const
void connectionBroken()
This signal is emitted when the connection is closed.
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...
TQ_UINT32 id()
Queries the ID of this object.
void setId(TQ_UINT32 id)
Sets the ID number of this object.
~KMessageIO()
The usual destructor, does nothing special.
virtual bool isNetwork() const
This class implements the message communication using a TCP/IP socket.
bool isConnected() const
Returns true if the socket is in state /e connected.
KMessageSocket(TQString host, TQ_UINT16 port, TQObject *parent=0, const char *name=0)
Connects to a server socket on /e host with /e port.
virtual int rtti() const
The runtime idendifcation.
virtual TQString peerName() const
void send(const TQByteArray &msg)
Overwritten slot method from KMessageIO.
virtual TQ_UINT16 peerPort() const
~KMessageSocket()
Destructor, closes the socket.