25 #ifndef KCLIENTSOCKETBASE_H
26 #define KCLIENTSOCKETBASE_H
31 #include "tdesocketbase.h"
32 #include "kresolver.h"
33 #include <tdelibs_export.h>
37 class KClientSocketBasePrivate;
105 SocketState state()
const;
111 virtual bool setSocketOptions(
int opts);
158 void setResolutionEnabled(
bool enable);
166 void setFamily(
int families);
185 virtual bool lookup();
206 virtual bool bind(
const TQString& node = TQString::null,
207 const TQString& service = TQString::null) = 0;
247 virtual bool connect(
const TQString& node = TQString::null,
248 const TQString& service = TQString::null) = 0;
262 { connect(host, TQString::number(port)); }
268 virtual bool disconnect();
276 {
return connect(); }
284 virtual void close();
296 virtual TQ_LONG bytesAvailable()
const;
301 virtual TQ_LONG waitForMore(
int msecs,
bool *timeout = 0L);
306 virtual TQ_LONG readBlock(
char *data, TQ_ULONG maxlen);
312 virtual TQ_LONG readBlock(
char *data, TQ_ULONG maxlen,
TDESocketAddress& from);
317 virtual TQ_LONG peekBlock(
char *data, TQ_ULONG maxlen);
323 virtual TQ_LONG peekBlock(
char *data, TQ_ULONG maxlen,
TDESocketAddress &from);
328 virtual TQ_LONG writeBlock(
const char *data, TQ_ULONG len);
334 virtual TQ_LONG writeBlock(
const char *data, TQ_ULONG len,
const TDESocketAddress& to);
349 bool emitsReadyRead()
const;
357 virtual void enableRead(
bool enable);
362 bool emitsReadyWrite()
const;
370 virtual void enableWrite(
bool enable);
384 virtual void slotReadActivity();
395 virtual void slotWriteActivity();
398 void lookupFinishedSlot();
409 void stateChanged(
int newstate);
416 void gotError(
int code);
490 void setState(SocketState state);
501 virtual void stateChanging(SocketState newState);
513 KClientSocketBasePrivate *d;
Abstract class for active sockets.
Name and service resolution results.
A namespace to store all networking-related (socket) classes.
virtual bool open(int)
Opens the socket.
Name and service resolution class.
void connectToHost(const TQString &host, TQ_UINT16 port)
virtual void flush()
This call is not supported on sockets.
Abstract client socket class.
SocketState
Socket states.
A generic socket address.