25#ifndef TDESOCKETDEVICE_H
26#define TDESOCKETDEVICE_H
28#include <tqsocketnotifier.h>
29#include "tdesocketbase.h"
34class TDESocketDeviceFactoryBase;
36class TDESocketDevicePrivate;
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;
402class TDESocketDeviceFactoryBase
405 TDESocketDeviceFactoryBase() {}
406 virtual ~TDESocketDeviceFactoryBase() {}
408 virtual TDESocketDevice* create(TDESocketBase*)
const = 0;
416class TDESocketDeviceFactory:
public TDESocketDeviceFactoryBase
419 TDESocketDeviceFactory() {}
420 virtual ~TDESocketDeviceFactory() {}
423 {
return new Impl(parent); }
KActiveSocketBase()
Constructor.
KPassiveSocketBase()
Constructor.
A generic socket address.
Basic socket functionality.
Low-level socket functionality.
virtual void flush()
This call is not supported on sockets.
virtual int capabilities() const
Returns the set of capabilities this socket class implements.
int socket() const
Returns the file descriptor for this socket.
int m_sockfd
The socket file descriptor.
TDESocketDevice(const TDESocketBase *=0L)
Default constructor.
Capabilities
Capabilities for the socket implementation.
@ CanConnectString
Can connect to hostnames.
@ CanNotUseDatagrams
Can not use datagrams.
@ CanBindString
Can bind to hostnames.
@ CanMulticast
Can send multicast as well as join/leave multicast groups.
@ CanNotListen
Can not listen.
@ CanNotBind
Can not bind.
A namespace to store all networking-related (socket) classes.