59 #include <tqiodevice.h>
62 #include "ksocketaddress.h"
63 #include <kdelibs_export.h>
72 #define IO_ListenError (IO_UnspecifiedError+1)
73 #define IO_AcceptError (IO_UnspecifiedError+2)
74 #define IO_LookupError (IO_UnspecifiedError+3)
75 #define IO_SocketCreateError (IO_UnspecifiedError+4)
76 #define IO_BindError (IO_UnspecifiedError+5)
85 class KSocketBasePrivate;
121 AddressReuseable = 0x02,
204 virtual bool setSocketOptions(
int opts);
215 virtual int socketOptions()
const;
233 virtual bool setBlocking(
bool enable);
241 bool blocking()
const;
257 virtual bool setAddressReuseable(
bool enable);
265 bool addressReuseable()
const;
282 virtual bool setIPv6Only(
bool enable);
290 bool isIPv6Only()
const;
303 virtual bool setBroadcast(
bool enable);
311 bool broadcast()
const;
357 int setRequestedCapabilities(
int add,
int remove = 0);
364 bool hasDevice()
const;
371 void setError(SocketError error);
378 SocketError error()
const;
383 inline TQString errorString()
const
401 TQMutex* mutex()
const;
409 static TQString errorString(SocketError code);
419 static bool isFatalError(
int code);
424 void unsetSocketDevice();
429 KSocketBasePrivate *d;
501 virtual bool disconnect() = 0;
508 virtual qint64 size()
const
510 virtual Offset size() const
518 virtual Offset at()
const
525 virtual bool at(Offset)
532 virtual bool atEnd()
const
540 virtual TQ_LONG bytesAvailable()
const = 0;
543 virtual qint64 bytesAvailable()
const = 0;
557 virtual TQ_LONG waitForMore(
int msecs,
bool *timeout = 0L) = 0;
565 virtual TQT_TQIO_LONG tqreadBlock(
char *data, TQT_TQIO_ULONG len) = 0;
578 virtual TQT_TQIO_LONG tqreadBlock(
char *data, TQT_TQIO_ULONG maxlen,
KSocketAddress& from) = 0;
591 virtual TQ_LONG peekBlock(
char *data, TQ_ULONG maxlen) = 0;
605 virtual TQ_LONG peekBlock(
char *data, TQ_ULONG maxlen,
KSocketAddress& from) = 0;
613 virtual TQT_TQIO_LONG tqwriteBlock(
const char *data, TQT_TQIO_ULONG len) = 0;
626 virtual TQT_TQIO_LONG tqwriteBlock(
const char *data, TQT_TQIO_ULONG len,
const KSocketAddress& to) = 0;
638 virtual int putch(
int ch);
644 virtual int ungetch(
int)
675 void setError(
int status, SocketError error);
731 virtual bool listen(
int backlog) = 0;
737 virtual void close() = 0;