Skip to content
Skip to link menu
Trinity API Reference
Trinity API Reference
kio/kio
kio/kio
kio
kio
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 <kio/slavebase.h>
32
33
34
namespace
KIO {
35
45
class
KIO_EXPORT
TCPSlaveBase
:
public
SlaveBase
46
{
47
public
:
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
57
protected
:
58
59
#ifndef KDE_NO_COMPAT
60
63
KDE_DEPRECATED ssize_t
Write
(
const
void
*data, ssize_t len) {
return
write( data, len ); }
64
68
KDE_DEPRECATED ssize_t
Read
(
void
*data, ssize_t len) {
return
read( data, len ); }
69
73
KDE_DEPRECATED ssize_t
ReadLine
(
char
*data, ssize_t len) {
return
readLine( data, len ); }
74
78
KDE_DEPRECATED
unsigned
short
int
GetPort
(
unsigned
short
int
p) {
return
port(p); }
79
83
KDE_DEPRECATED
bool
ConnectToHost(
const
TQString &host,
unsigned
int
port,
84
bool
sendError ) {
return
connectToHost( host, port, sendError ); }
85
89
KDE_DEPRECATED
void
CloseDescriptor
() { closeDescriptor(); }
90
94
KDE_DEPRECATED
bool
AtEOF
() {
return
atEnd(); }
95
99
KDE_DEPRECATED
bool
InitializeSSL
() {
return
initializeSSL(); }
100
104
KDE_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
369
protected
:
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
377
private
:
378
bool
doSSLHandShake(
bool
sendError );
379
380
protected
:
381
virtual
void
virtual_hook(
int
id
,
void
* data );
382
private
:
383
class
TcpSlaveBasePrivate;
384
TcpSlaveBasePrivate *d;
385
};
386
387
}
388
389
#endif
kio/kio
Skip menu "kio/kio"
Main Page
Modules
Namespace List
Class Hierarchy
Alphabetical List
Class List
File List
Namespace Members
Class Members
Related Pages
kio/kio
Skip menu "kio/kio"
arts
dcop
dnssd
interfaces
interface
library
kspeech
ktexteditor
kabc
kate
kcmshell
kdecore
kded
kdefx
kdeprint
kdesu
kdeui
kdoctools
khtml
kimgio
kinit
kio
bookmarks
httpfilter
kfile
kio
kioexec
kpasswdserver
kssl
kioslave
http
kjs
kmdi
kmdi
knewstuff
kparts
krandr
kresources
kspell2
kunittest
kutils
kwallet
libkmid
libkscreensaver