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

tdeio/tdeio

  • tdeio
  • tdeio
tcpslavebase.h
1/*
2 * Copyright (C) 2000 Alex Zepeda <zipzippy@sonic.net>
3 * Copyright (C) 2001 George Staikos <staikos@kde.org>
4 * Copyright (C) 2001 Dawit Alemayehu <adawit@kde.org>
5 *
6 * This file is part of the KDE project
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIB. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22 */
23
24#ifndef _TCP_SLAVEBASE_H
25#define _TCP_SLAVEBASE_H
26
27#include <sys/types.h>
28#include <stdio.h>
29
30#include <kextsock.h>
31#include <tdeio/slavebase.h>
32
33
34namespace TDEIO {
35
45class TDEIO_EXPORT TCPSlaveBase : public SlaveBase
46{
47public:
48 TCPSlaveBase(unsigned short int defaultPort, const TQCString &protocol,
49 const TQCString &poolSocket, const TQCString &appSocket);
50
51 TCPSlaveBase(unsigned short int defaultPort, const TQCString &protocol,
52 const TQCString &poolSocket, const TQCString &appSocket,
53 bool useSSL);
54
55 virtual ~TCPSlaveBase();
56
57protected:
58
59#ifndef KDE_NO_COMPAT
63 TDE_DEPRECATED ssize_t Write(const void *data, ssize_t len) { return write( data, len ); }
64
68 TDE_DEPRECATED ssize_t Read(void *data, ssize_t len) { return read( data, len ); }
69
73 TDE_DEPRECATED ssize_t ReadLine(char *data, ssize_t len) { return readLine( data, len ); }
74
78 TDE_DEPRECATED unsigned short int GetPort(unsigned short int p) { return port(p); }
79
83 TDE_DEPRECATED bool ConnectToHost( const TQString &host, unsigned int port,
84 bool sendError ) { return connectToHost( host, port, sendError ); }
85
89 TDE_DEPRECATED void CloseDescriptor() { closeDescriptor(); }
90
94 TDE_DEPRECATED bool AtEOF() { return atEnd(); }
95
99 TDE_DEPRECATED bool InitializeSSL() { return initializeSSL(); }
100
104 TDE_DEPRECATED void CleanSSL() { cleanSSL(); }
105#endif
106
117 ssize_t write(const void *data, ssize_t len);
118
129 ssize_t read(void *data, ssize_t len);
130
134 ssize_t readLine(char *data, ssize_t len);
135
143 void setBlockSize(int sz);
144
153 unsigned short int port(unsigned short int _port);
154
173 bool connectToHost( const TQString &host, unsigned int port,
174 bool sendError = true );
175
183 bool usingSSL() const { return m_bIsSSL; }
184
192 bool usingTLS() const;
193
201 bool usingTLS();
202
209 bool canUseTLS();
210
220 int startTLS();
221
225 void stopTLS();
226
234 void closeDescriptor();
235
236
240 bool atEnd();
241
242
249 void setSSLMetaData();
250
251
255 bool initializeSSL();
256
257
261 void cleanSSL();
262
272 bool isConnectionValid();
273
284 int connectResult();
285
296 bool waitForResponse( int t );
297
307 void setBlockConnection( bool b );
308
319 void setConnectTimeout( int t );
320
326 bool isSSLTunnelEnabled();
327
343 void setEnableSSLTunnel( bool enable );
344
355 void setRealHost( const TQString& realHost );
356
357 // don't use me!
358 void doConstructorStuff();
359
360 // For the certificate verification code
361 int verifyCertificate();
362
363 // For prompting for the certificate to use
364 void certificatePrompt();
365
366 // Did the user abort (as the reason for connectToHost returning false)
367 bool userAborted() const;
368
369protected:
370 int m_iSock;
371 bool m_bIsSSL;
372 unsigned short int m_iPort;
373 unsigned short int m_iDefaultPort;
374 TQCString m_sServiceName;
375 FILE *fp;
376
377private:
378 bool doSSLHandShake( bool sendError );
379
380protected:
381 virtual void virtual_hook( int id, void* data );
382private:
383 class TcpSlaveBasePrivate;
384 TcpSlaveBasePrivate *d;
385};
386
387}
388
389#endif
TDEIO::SlaveBase
There are two classes that specifies the protocol between application (job) and tdeioslave.
Definition: slavebase.h:46
TDEIO::TCPSlaveBase
There are two classes that specifies the protocol between application (job) and tdeioslave.
Definition: tcpslavebase.h:46
TDEIO::TCPSlaveBase::usingSSL
bool usingSSL() const
Are we using SSL?
Definition: tcpslavebase.h:183
TDEIO::TCPSlaveBase::ReadLine
TDE_DEPRECATED ssize_t ReadLine(char *data, ssize_t len)
Definition: tcpslavebase.h:73
TDEIO::TCPSlaveBase::CloseDescriptor
TDE_DEPRECATED void CloseDescriptor()
Definition: tcpslavebase.h:89
TDEIO::TCPSlaveBase::CleanSSL
TDE_DEPRECATED void CleanSSL()
Definition: tcpslavebase.h:104
TDEIO::TCPSlaveBase::InitializeSSL
TDE_DEPRECATED bool InitializeSSL()
Definition: tcpslavebase.h:99
TDEIO::TCPSlaveBase::ConnectToHost
TDE_DEPRECATED bool ConnectToHost(const TQString &host, unsigned int port, bool sendError)
Definition: tcpslavebase.h:83
TDEIO::TCPSlaveBase::GetPort
TDE_DEPRECATED unsigned short int GetPort(unsigned short int p)
Definition: tcpslavebase.h:78
TDEIO::TCPSlaveBase::Write
TDE_DEPRECATED ssize_t Write(const void *data, ssize_t len)
Definition: tcpslavebase.h:63
TDEIO::TCPSlaveBase::AtEOF
TDE_DEPRECATED bool AtEOF()
Definition: tcpslavebase.h:94
TDEIO::TCPSlaveBase::Read
TDE_DEPRECATED ssize_t Read(void *data, ssize_t len)
Definition: tcpslavebase.h:68
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.4
This website is maintained by Timothy Pearson.