25 #ifndef KSOCKETDEVICE_H 26 #define KSOCKETDEVICE_H 28 #include <tqsocketnotifier.h> 29 #include "ksocketbase.h" 34 class KSocketDeviceFactoryBase;
36 class KSocketDevicePrivate;
67 CanConnectString = 0x01,
90 CanNotUseDatagrams = 0x20
140 virtual bool setSocketOptions(
int opts);
145 virtual bool open(TQ_OpenMode mode);
152 virtual void close();
164 virtual bool create(
int family,
int type,
int protocol);
180 virtual bool listen(
int backlog = 5);
196 virtual bool disconnect();
202 virtual TQ_LONG bytesAvailable()
const;
205 virtual qint64 bytesAvailable()
const;
214 virtual TQ_LONG waitForMore(
int msecs,
bool *timeout = 0L);
219 virtual TQT_TQIO_LONG tqreadBlock(
char *data, TQT_TQIO_ULONG maxlen);
224 virtual TQT_TQIO_LONG tqreadBlock(
char *data, TQT_TQIO_ULONG maxlen,
KSocketAddress& from);
229 virtual TQ_LONG peekBlock(
char *data, TQ_ULONG maxlen);
234 virtual TQ_LONG peekBlock(
char *data, TQ_ULONG maxlen,
KSocketAddress& from);
239 virtual TQT_TQIO_LONG tqwriteBlock(
const char *data, TQT_TQIO_ULONG len);
244 virtual TQT_TQIO_LONG tqwriteBlock(
const char *data, TQT_TQIO_ULONG len,
const KSocketAddress& to);
280 TQSocketNotifier* readNotifier()
const;
288 TQSocketNotifier* writeNotifier()
const;
296 TQSocketNotifier* exceptionNotifier()
const;
316 virtual bool poll(
bool* input,
bool* output,
bool* exception = 0L,
317 int timeout = -1,
bool* timedout = 0L);
330 bool poll(
int timeout = -1,
bool* timedout = 0L);
357 virtual TQSocketNotifier* createNotifier(TQSocketNotifier::Type type)
const;
388 static KSocketDeviceFactoryBase* setDefaultImpl(KSocketDeviceFactoryBase* factory);
394 static void addNewImpl(KSocketDeviceFactoryBase* factory,
int capabilities);
400 KSocketDevicePrivate *d;
407 class KSocketDeviceFactoryBase
410 KSocketDeviceFactoryBase() {}
411 virtual ~KSocketDeviceFactoryBase() {}
428 {
return new Impl(parent); }
Abstract class for active sockets.
A generic socket address.
A namespace to store all networking-related (socket) classes.
virtual void flush()
This call is not supported on sockets.
int socket() const
Returns the file descriptor for this socket.
This class provides functionality for creating and registering socket implementations.
int m_sockfd
The socket file descriptor.
virtual int capabilities() const
Returns the set of capabilities this socket class implements.
Capabilities
Capabilities for the socket implementation.
Low-level socket functionality.
Abstract base class for passive sockets.
Basic socket functionality.