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(
int 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();
201 virtual TQ_LONG bytesAvailable()
const;
209 virtual TQ_LONG waitForMore(
int msecs,
bool *timeout = 0L);
214 virtual TQ_LONG readBlock(
char *data, TQ_ULONG maxlen);
219 virtual TQ_LONG readBlock(
char *data, TQ_ULONG maxlen,
TDESocketAddress& from);
224 virtual TQ_LONG peekBlock(
char *data, TQ_ULONG maxlen);
229 virtual TQ_LONG peekBlock(
char *data, TQ_ULONG maxlen,
TDESocketAddress& from);
234 virtual TQ_LONG writeBlock(
const char *data, TQ_ULONG len);
239 virtual TQ_LONG writeBlock(
const char *data, TQ_ULONG len,
const TDESocketAddress& to);
275 TQSocketNotifier* readNotifier()
const;
283 TQSocketNotifier* writeNotifier()
const;
291 TQSocketNotifier* exceptionNotifier()
const;
311 virtual bool poll(
bool* input,
bool* output,
bool* exception = 0L,
312 int timeout = -1,
bool* timedout = 0L);
325 bool poll(
int timeout = -1,
bool* timedout = 0L);
352 virtual TQSocketNotifier* createNotifier(TQSocketNotifier::Type type)
const;
383 static TDESocketDeviceFactoryBase* setDefaultImpl(TDESocketDeviceFactoryBase* factory);
389 static void addNewImpl(TDESocketDeviceFactoryBase* factory,
int capabilities);
395 TDESocketDevicePrivate *d;
402 class TDESocketDeviceFactoryBase
405 TDESocketDeviceFactoryBase() {}
406 virtual ~TDESocketDeviceFactoryBase() {}
408 virtual TDESocketDevice*
create(TDESocketBase*)
const = 0;
423 {
return new Impl(parent); }
int m_sockfd
The socket file descriptor.
Abstract class for active sockets.
virtual void flush()
This call is not supported on sockets.
A namespace to store all networking-related (socket) classes.
int socket() const
Returns the file descriptor for this socket.
Basic socket functionality.
Low-level socket functionality.
virtual int capabilities() const
Returns the set of capabilities this socket class implements.
Abstract base class for passive sockets.
TDEAction * create(StdAction id, const char *name, const TQObject *recvr, const char *slot, TDEActionCollection *parent)
A generic socket address.
Capabilities
Capabilities for the socket implementation.
This class provides functionality for creating and registering socket implementations.