Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QIrServer class represents an Infrared TinyTP server socket. More...
#include <QIrServer>
Inherits QObject.
The QIrServer class represents an Infrared TinyTP server socket.
This class makes it possible to accept incoming Infrared connections. You can specify the service identifier that this socket represents to be automatically advertised in the IAS database.
Call listen() to make the server listen for new connections. The newConnection() signal will be emmited each time a client connects to the server.
Call nextPendingConnection() to accept the pending client connection.
When listening for connections, server service descriptor is available by calling serverService().
Calling close() will make the QIrServer stop listening for connections and delete all pending connections.
See also QIrSocket.
Constructs a new QIrServer with parent parent. The server is in the UnconnectedState.
Destroys the server.
Closes the server. The server will no longer listen for incoming connections and all pending connections will be closed.
See also isListening() and socketDescriptor().
Returns a human-readable description of the last device error that occurred.
See also serverError().
Returns true if the server has a pending connection(s); otherwise returns false.
See also nextPendingConnection() and setMaxPendingConnections().
Returns true if the server is currently listening for remote connections, and false otherwise.
See also close() and socketDescriptor().
Tells the server to listen for incoming connections. The service will be automatically added to the IAS database and an Ir LSAP selector will be automatically chosen.
The classes contains the service hints for this service. If the system supports setting of the service hints they will be set into the IAS database automatically, otherwise passing this parameter will have no effect.
Returns true on success; otherwise returns false.
See also isListening().
Returns the maximum number of pending accepted connections. The default is 1.
See also setMaxPendingConnections() and hasPendingConnections().
This signal is emitted every time a new connection is available. Call nextPendingConnection() in order to accept the connection.
See also hasPendingConnections() and nextPendingConnection().
Returns the next pending connection as a connected QIrSocket object. The function returns a pointer to a QIrSocket in QIrSocket::ConnectedState that you can use for communicating with the client.
The socket is created as a child of the server, which means that it is automatically deleted when the QIrServer object is destroyed. It is still a good idea to delete the object explicitly when you are done with it, to avoid wasting memory.
A NULL pointer is returned if this function is called when there are no pending connections.
See also hasPendingConnections().
Returns the service hint set that this socket has been created with. The service hints are added to the IAS database automatically.
Note that this functionality might not be supported on some systems in which case this function will always return an empty set.
See also listen() and serverService().
Returns the last error that has occurred.
See also errorString().
Returns the service descriptor this socket has been created with. The service descriptor is added to the IAS database automatically.
See also listen() and serverDeviceClasses().
Sets the maximum number of pending accepted connections to numConnections. QIrServer will accept no more than numConnections incoming connections before nextPendingConnection() is called. By default, the limit is 1 pending connection.
See also maxPendingConnections() and hasPendingConnections().
Returns the socket descriptor the server is currently listening on. If the server is not listening, then -1 is returned.
See also isListening().
Waits for at most msecs milliseconds or until an incoming connection is available. Returns true if a connection is available; otherwise returns false. If the operation timed out and timedOut is not 0, *timedOut will be set to true.
This is a blocking function call. Its use is not advised in a single-threaded GUI application, since the whole application will stop responding until the function returns. waitForNewConnection() is mostly useful when there is no event loop available.
The non-blocking alternative is to connect to the newConnection() signal.
See also hasPendingConnections() and nextPendingConnection().
Copyright © 2009 Nokia | Trademarks | Qt Extended 4.4.3 |