Into

Modules

Documentation

classPiiLocalServer

#include <PiiLocalServer.h>

A threaded server that runs an application layer protocol over a local socket.

Inherits PiiNetworkServer

Description

On Unix, this means a Unix-domain socket. On Windows, pipes are used.

Constructors and destructor

Public member functions

virtual QIODevice *

Creates a new QLocalSocket and assigns socketDescriptor to it.

virtual QString
virtual bool
( )

Set the name of the socket/pipe to bind to.

virtual bool
( )

Start the server.

virtual void
(
  • PiiNetwork::StopMode mode
)

Sends a stop signal to the server.

Function details

  • PiiLocalServer

    ( )
  • ~PiiLocalServer

    ()
  • virtual QIODevice * createSocket

    ( )
    [virtual]

    Creates a new QLocalSocket and assigns socketDescriptor to it.

    Reimplemented from PiiNetworkServerThread::Controller.

  • virtual QString serverAddress

    ()
    [virtual]

    Reimplemented from PiiNetworkServer.

  • virtual bool setServerAddress

    ( )
    [virtual]

    Set the name of the socket/pipe to bind to.

    On Unix, this is the name of the socket file. On windows, use a pipe path.

    See also
    • QLocalServer::listen()

    Reimplemented from PiiNetworkServer.

  • virtual bool start

    ()
    [virtual]

    Start the server.

    This function will create a local socket and bind it to the Unix domain socket/pipe specified. If the server cannot listen to the socket, it will return false.

    Note that this function will not block. If the server starts successfully, it will continue running in the backround.

    Reimplemented from PiiNetworkServer.

  • virtual void stop

    (
    • PiiNetwork::StopMode mode
    )
    [virtual]

    Sends a stop signal to the server.

    This function stops all worker threads and waits until they are done. Subclasses may implement any additional functionality related to stopping the server. Typically, the overridden first calls this function and then closes the low-level server interface.

    See also
    • QTcpServer::close()

    Reimplemented from PiiNetworkServer.

Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.