Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |
The TQServerSocket class provides a TCP-based server. More...
#include <ntqserversocket.h>
Inherits TQObject.
This class is a convenience class for accepting incoming TCP connections. You can specify the port or have TQServerSocket pick one, and listen on just one address or on all the machine's addresses.
Using the API is very simple: subclass TQServerSocket, call the constructor of your choice, and implement newConnection() to handle new incoming connections. There is nothing more to do.
(Note that due to lack of support in the underlying APIs, TQServerSocket cannot accept or reject connections conditionally.)
See also TQSocket, TQSocketDevice, TQHostAddress, TQSocketNotifier, and Input/Output and Networking.
The parent and name arguments are passed on to the TQObject constructor.
Warning: On Tru64 Unix systems a value of 0 for backlog means that you don't accept any connections at all; you should specify a value larger than 0.
The parent and name arguments are passed on to the TQObject constructor.
Warning: On Tru64 Unix systems a value of 0 for backlog means that you don't accept any connections at all; you should specify a value larger than 0.
This constructor, in combination with setSocket(), allows us to use the TQServerSocket class as a wrapper for other socket types (e.g. Unix Domain Sockets under Unix).
The parent and name arguments are passed on to the TQObject constructor.
See also setSocket().
This causes any backlogged connections (connections that have reached the host, but not yet been completely set up by calling TQSocketDevice::accept()) to be severed.
Existing connections continue to exist; this only affects the acceptance of new connections.
See also port() and TQSocketDevice::address().
This pure virtual function is responsible for setting up a new incoming connection. socket is the fd (file descriptor) for the newly accepted connection.
See also address() and TQSocketDevice::port().
Example: network/httpd/httpd.cpp.
This allows us to use the TQServerSocket class as a wrapper for other socket types (e.g. Unix Domain Sockets).
There is normally no need to manipulate the socket device directly since this class does all the necessary setup for most client or server socket applications.
This file is part of the TQt toolkit. Copyright © 1995-2007 Trolltech. All Rights Reserved.
Copyright © 2007 Trolltech | Trademarks | TQt 3.3.8
|