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;
384 {
return errorString(error()); }
401 TQMutex* mutex()
const;
419 static bool isFatalError(
int code);
424 void unsetSocketDevice();
429 KSocketBasePrivate *d;
501 virtual bool disconnect() = 0;
508 virtual qint64 size()
const 518 virtual Offset
at()
const 525 virtual bool at(Offset)
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);
731 virtual bool listen(
int backlog) = 0;
737 virtual void close() = 0;
virtual Offset size() const
This call is not supported on sockets.
Abstract class for active sockets.
A generic socket address.
A namespace to store all networking-related (socket) classes.
SocketError
Possible socket error codes.
virtual int ungetch(int)
This call is not supported on sockets.
SocketOptions
Possible socket options.
virtual bool at(Offset)
This call is not supported on sockets.
virtual bool atEnd() const
This call is not supported on sockets.
virtual Offset at() const
This call is not supported on sockets.
TQString errorString() const
Returns the error string corresponding to this error condition.
Low-level socket functionality.
Abstract base class for passive sockets.
Basic socket functionality.