25 #ifndef TDESOCKETDEVICE_H
26 #define TDESOCKETDEVICE_H
28 #include <tqsocketnotifier.h>
29 #include "tdesocketbase.h"
33 class TDESocketDevice;
34 class TDESocketDeviceFactoryBase;
36 class TDESocketDevicePrivate;
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,
TDESocketAddress& from);
229 virtual TQ_LONG peekBlock(
char *data, TQ_ULONG maxlen);
234 virtual TQ_LONG peekBlock(
char *data, TQ_ULONG maxlen,
TDESocketAddress& 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 TDESocketAddress& 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 TDESocketDeviceFactoryBase* setDefaultImpl(TDESocketDeviceFactoryBase* factory);
394 static void addNewImpl(TDESocketDeviceFactoryBase* factory,
int capabilities);
400 TDESocketDevicePrivate *d;
407 class TDESocketDeviceFactoryBase
410 TDESocketDeviceFactoryBase() {}
411 virtual ~TDESocketDeviceFactoryBase() {}
413 virtual TDESocketDevice*
create(TDESocketBase*)
const = 0;
428 {
return new Impl(parent); }
A generic socket address.
Abstract class for active sockets.
This class provides functionality for creating and registering socket implementations.
Low-level socket functionality.
A namespace to store all networking-related (socket) classes.
int socket() const
Returns the file descriptor for this socket.
Capabilities
Capabilities for the socket implementation.
int m_sockfd
The socket file descriptor.
virtual void flush()
This call is not supported on sockets.
virtual int capabilities() const
Returns the set of capabilities this socket class implements.
Basic socket functionality.
TDEAction * create(StdAction id, const char *name, const TQObject *recvr, const char *slot, TDEActionCollection *parent)
Abstract base class for passive sockets.