• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdeio
 

tdeio/tdeio

  • tdeio
  • tdeio
connection.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2000 Stephan Kulow <coolo@kde.org>
3  David Faure <faure@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef __connection_h__
22 #define __connection_h__
23 
24 #include <tdelibs_export.h>
25 
26 #include <sys/types.h>
27 
28 #include <stdio.h>
29 #include <tqptrlist.h>
30 #include <tqobject.h>
31 
32 class TDESocket;
33 class TQSocketNotifier;
34 
35 namespace TDEIO {
36 
37  struct TDEIO_EXPORT Task {
38  int cmd;
39  TQByteArray data;
40  };
41 
48  class TDEIO_EXPORT Connection : public TQObject
49  {
50  TQ_OBJECT
51  public:
56  Connection();
57  virtual ~Connection();
58 
64  void init(TDESocket *sock);
72  void init(int fd_in, int fd_out); // Used by KDENOX
73  void connect(TQObject *receiver = 0, const char *member = 0);
75  void close();
76 
81  int fd_from() const { return fd_in; }
86  int fd_to() const { return fileno( f_out ); }
87 
93  bool inited() const { return (fd_in != -1) && (f_out != 0); }
94 
100  void send(int cmd, const TQByteArray &arr = TQByteArray());
101 
108  bool sendnow( int _cmd, const TQByteArray &data );
109 
118  int read( int* _cmd, TQByteArray &data );
119 
123  void suspend();
124 
128  void resume();
129 
134  bool suspended() const { return m_suspended; }
135 
136  protected slots:
137  void dequeue();
138 
139  protected:
140 
141 
142  private:
143  int fd_in;
144  FILE *f_out;
145  TDESocket *socket;
146  TQSocketNotifier *notifier;
147  TQObject *receiver;
148  const char *member;
149  TQPtrList<Task> tasks;
150  bool m_suspended;
151  private:
152  class ConnectionPrivate* d;
153  };
154 
155 }
156 
157 #endif
TDEIO::Connection
This class provides a simple means for IPC between two applications via a pipe.
Definition: connection.h:49
TDEIO::Connection::inited
bool inited() const
Checks whether the connection has been initialized.
Definition: connection.h:93
TDEIO::Connection::fd_from
int fd_from() const
Returns the input file descriptor.
Definition: connection.h:81
TDEIO::Connection::suspended
bool suspended() const
Definition: connection.h:134
TDEIO::Connection::fd_to
int fd_to() const
Returns the output file descriptor.
Definition: connection.h:86
TDEIO
A namespace for TDEIO globals.
Definition: authinfo.h:29

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.9.1
This website is maintained by Timothy Pearson.