The QLlcpServer class provides an NFC LLCP socket based server. More...
#include <QLlcpServer>
Inherits: QObject.
This class was introduced in Qt Mobility 1.2.
QLlcpServer ( QObject * parent = 0 ) | |
virtual | ~QLlcpServer () |
void | close () |
virtual bool | hasPendingConnections () const |
bool | isListening () const |
bool | listen ( const QString & serviceUri ) |
virtual QLlcpSocket * | nextPendingConnection () |
QLlcpSocket::SocketError | serverError () const |
quint8 | serverPort () const |
QString | serviceUri () const |
void | newConnection () |
The QLlcpServer class provides an NFC LLCP socket based server.
This class makes it possible to accept incoming LLCP socket connections.
Call listen() to have the server start listening for incoming connections on a specified port. The newConnection() signal is then emitted each time a client connects to the server.
Call nextPendingConnection() to accept the pending connection as a connected QLlcpSocket. The function returns a pointer to a QLlcpSocket that can be used for communicating with the client.
If an error occurs, serverError() returns the type of error, and errorString() can be called to get a human readable description of what happened.
When listening for connections, the port which the server is listening on is available through serverPort().
Calling close() makes QLlcpServer stop listening for incoming connections.
Constructs a new NFC LLCP server with parent.
Destroys the NFC LLCP server.
Stops listening for incoming connections.
Returns true if the server has a pending connection; otherwise returns false.
See also nextPendingConnection().
Returns true if the server is listening for incoming connections; otherwise returns false.
Tells the server to listen for incoming connections on serviceUri. If the server is currently listening then it will return false. Returns true on success; otherwise returns false.
serviceUri() will return the serviceUri that is passed into listen.
serverPort() will return the port that is assigned to the server.
See also serverPort(), isListening(), and close().
This signal is emitted every time a new connection is available.
See also hasPendingConnections() and nextPendingConnection().
Returns the next pending connection as a connected QLlcpSocket object.
The socket is created as a child of the server, which means that it is automatically deleted when the QLlcpServer object is destroyed. It is still a good idea to delete the object explicitly when you are done with it, to avoid wasting memory.
0 is returned if this function is called when there are no pending connections.
See also hasPendingConnections() and newConnection().
Returns the last error that occurred.
Returns the LLCP port associated with the service URI that the server is listening on.
Note: This call is not supported on all platforms and will return 0 on these platforms.
Returns the LLCP service URI that the server is listening on.