24#ifndef _TCP_SLAVEBASE_H
25#define _TCP_SLAVEBASE_H
31#include <tdeio/slavebase.h>
45class TDEIO_EXPORT TCPSlaveBase :
public SlaveBase
48 TCPSlaveBase(
unsigned short int defaultPort,
const TQCString &protocol,
49 const TQCString &poolSocket,
const TQCString &appSocket);
51 TCPSlaveBase(
unsigned short int defaultPort,
const TQCString &protocol,
52 const TQCString &poolSocket,
const TQCString &appSocket,
55 virtual ~TCPSlaveBase();
78 TDE_DEPRECATED
unsigned short int GetPort(
unsigned short int p) {
return port(p); }
117 ssize_t write(
const void *data, ssize_t len);
129 ssize_t read(
void *data, ssize_t len);
134 ssize_t readLine(
char *data, ssize_t len);
143 void setBlockSize(
int sz);
153 unsigned short int port(
unsigned short int _port);
173 bool connectToHost(
const TQString &host,
unsigned int port,
174 bool sendError =
true );
192 bool usingTLS()
const;
234 void closeDescriptor();
249 void setSSLMetaData();
255 bool initializeSSL();
272 bool isConnectionValid();
296 bool waitForResponse(
int t );
307 void setBlockConnection(
bool b );
319 void setConnectTimeout(
int t );
326 bool isSSLTunnelEnabled();
343 void setEnableSSLTunnel(
bool enable );
355 void setRealHost(
const TQString& realHost );
358 void doConstructorStuff();
361 int verifyCertificate();
364 void certificatePrompt();
367 bool userAborted()
const;
372 unsigned short int m_iPort;
373 unsigned short int m_iDefaultPort;
374 TQCString m_sServiceName;
378 bool doSSLHandShake(
bool sendError );
381 virtual void virtual_hook(
int id,
void* data );
383 class TcpSlaveBasePrivate;
384 TcpSlaveBasePrivate *d;
void data(const TQByteArray &data)
Sends data in the slave to the job (i.e.
bool usingSSL() const
Are we using SSL?
TDE_DEPRECATED ssize_t ReadLine(char *data, ssize_t len)
bool atEnd()
Returns true when end of data is reached.
TDE_DEPRECATED void CloseDescriptor()
bool initializeSSL()
Initializs all SSL variables.
void cleanSSL()
Cleans up all SSL settings.
TDE_DEPRECATED void CleanSSL()
TDE_DEPRECATED bool InitializeSSL()
ssize_t write(const void *data, ssize_t len)
This function acts like standard write function call except it is also capable of making SSL or SOCKS...
bool connectToHost(const TQString &host, unsigned int port, bool sendError=true)
Performs the initial TCP connection stuff and/or SSL handshaking as necessary.
TDE_DEPRECATED bool ConnectToHost(const TQString &host, unsigned int port, bool sendError)
TDE_DEPRECATED unsigned short int GetPort(unsigned short int p)
void closeDescriptor()
Closes the current file descriptor.
ssize_t readLine(char *data, ssize_t len)
Same as above except it reads data one line at a time.
TDE_DEPRECATED ssize_t Write(const void *data, ssize_t len)
ssize_t read(void *data, ssize_t len)
This function acts like standard read function call except it is also capable of deciphering SSL data...
TDE_DEPRECATED bool AtEOF()
unsigned short int port(unsigned short int _port)
Determines the appropriate port to use.
TDE_DEPRECATED ssize_t Read(void *data, ssize_t len)
A namespace for TDEIO globals.