#include <stream.h>
Signals | |
void | newConnection () |
Emitted when a new connection arrives. | |
Public Member Functions | |
StreamServer (Host *host, QObject *parent=NULL) | |
Create a StreamServer instance. | |
bool | listen (const QString &serviceName, const QString &serviceDesc, const QString &protocolName, const QString &protocolDesc) |
Listen for incoming connections to a particular service using a particular application protocol. | |
bool | isListening () |
Returns true if this StreamServer is currently listening. | |
Stream * | accept () |
Accept an incoming connection as a top-level Stream. | |
Stream * | accept (QByteArray &originHostId) |
Accept an incoming connection, and obtain the EID of the originating host. | |
QString | serviceName () |
Returns the service name previously supplied to listen(). | |
QString | serviceDescription () |
Returns the service description previously supplied to listen(). | |
QString | protocolName () |
Returns the protocol name previously supplied to listen(). | |
QString | protocolDescription () |
Returns the protocol description previously supplied to listen(). | |
QString | errorString () |
Returns a string describing the last error that occurred, if any. | |
Protected Member Functions | |
void | setErrorString (const QString &err) |
Set the current error description string. | |
Friends | |
class | BaseStream |
To use this class, the application creates a StreamServer instance, calls listen() to begin listening for connections, and upon arrival of a newConnection() signal uses accept() to accept any queued incoming connections.
|
Create a StreamServer instance. The application must call listen() before the StreamServer will actually accept incoming connections.
|
|
Accept an incoming connection, and obtain the EID of the originating host. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. |
|
Accept an incoming connection as a top-level Stream. Upon receiving a newConnection() signal, the application must call accept() in a loop until there are no more incoming connections to accept. Stream objects returned from this method initially have the StreamServer as their Qt parent, so they are automatically deleted if the StreamServer is deleted. The application may re-parent these Stream objects if desired, in which case the Stream may outlive the StreamServer object.
|
|
Listen for incoming connections to a particular service using a particular application protocol. This method may only be called once on a StreamServer instance. An error occurs if another StreamServer object is already listening on the specified service/protocol name pair on this host.
|