56 #ifndef TDESOCKETBASE_H 57 #define TDESOCKETBASE_H 59 #include <tqiodevice.h> 62 #include "tdesocketaddress.h" 63 #include <tdelibs_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) 83 class TDESocketDevice;
85 class TDESocketBasePrivate;
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 TDESocketBasePrivate *d;
501 virtual bool disconnect() = 0;
514 virtual Offset
at()
const 521 virtual bool at(Offset)
535 virtual TQ_LONG bytesAvailable()
const = 0;
548 virtual TQ_LONG waitForMore(
int msecs,
bool *timeout = 0L) = 0;
556 virtual TQT_TQIO_LONG tqreadBlock(
char *data, TQT_TQIO_ULONG len) = 0;
569 virtual TQT_TQIO_LONG tqreadBlock(
char *data, TQT_TQIO_ULONG maxlen,
TDESocketAddress& from) = 0;
582 virtual TQ_LONG peekBlock(
char *data, TQ_ULONG maxlen) = 0;
596 virtual TQ_LONG peekBlock(
char *data, TQ_ULONG maxlen,
TDESocketAddress& from) = 0;
604 virtual TQT_TQIO_LONG tqwriteBlock(
const char *data, TQT_TQIO_ULONG len) = 0;
617 virtual TQT_TQIO_LONG tqwriteBlock(
const char *data, TQT_TQIO_ULONG len,
const TDESocketAddress& to) = 0;
629 virtual int putch(
int ch);
722 virtual bool listen(
int backlog) = 0;
728 virtual void close() = 0;
A generic socket address.
virtual bool atEnd() const
This call is not supported on sockets.
Abstract class for active sockets.
Low-level socket functionality.
A namespace to store all networking-related (socket) classes.
virtual Offset at() const
This call is not supported on sockets.
virtual Offset size() const
This call is not supported on sockets.
virtual int ungetch(int)
This call is not supported on sockets.
virtual bool at(Offset)
This call is not supported on sockets.
SocketOptions
Possible socket options.
SocketError
Possible socket error codes.
TQString errorString() const
Returns the error string corresponding to this error condition.
Basic socket functionality.
Abstract base class for passive sockets.