xTitan
 All Classes Functions Groups
Classes | Signals | Public Member Functions | List of all members
xtitan::SimpleServer Class Reference

A simple network server. More...

Inheritance diagram for xtitan::SimpleServer:

Classes

class  Private
 

Signals

void newConnection ()
 

Public Member Functions

 SimpleServer (QObject *parent=0)
 Constructor. More...
 
void close ()
 stop listening client More...
 
QString errorString () const
 get last error message More...
 
QString fullServerName () const
 get pipe name More...
 
bool hasPendingConnections () const
 check for more connections More...
 
bool isListening () const
 check listening state More...
 
bool listen (const QString &name, bool replace=false)
 listen to a local server More...
 
SimpleSocketnextPendingConnection ()
 get next pending connection More...
 
QAbstractSocket::SocketError serverError () const
 get last server error code More...
 
QString serverName () const
 get short pipe name More...
 

Detailed Description

A simple network server.

Constructor & Destructor Documentation

SimpleServer::SimpleServer ( QObject *  parent = 0)
explicit

Constructor.

Parameters
parentparent of this QObject

Member Function Documentation

void SimpleServer::close ( )

stop listening client

See Also
listen()
QString SimpleServer::errorString ( ) const

get last error message

Returns
error message
QString SimpleServer::fullServerName ( ) const

get pipe name

Returns
full pipe name
bool SimpleServer::hasPendingConnections ( ) const

check for more connections

Returns
true if there is any pending connection
bool SimpleServer::isListening ( ) const

check listening state

Returns
true if listening
bool SimpleServer::listen ( const QString &  name,
bool  replace = false 
)

listen to a local server

Parameters
[in]namelocal server name
[in]replacereplace server if exists
Returns
true if listen successful

This function listen on a local server, i.e. a named pipe.

Under UNIX-like system, they won't remove local server automatically, so you replace flag to force replace existing server.

SimpleSocket * SimpleServer::nextPendingConnection ( )

get next pending connection

Returns
pending connection, null if no pending connection
QAbstractSocket::SocketError SimpleServer::serverError ( ) const

get last server error code

Returns
error code
QString SimpleServer::serverName ( ) const

get short pipe name

Returns
short pipe name

The documentation for this class was generated from the following files: