class Poco::Net::TCPServerParams

Overview

This class is used to specify parameters to both the TCPServer, as well as to TCPServerDispatcher objects. Moreā€¦

#include <TCPServerParams.h>

class TCPServerParams: public Poco::RefCountedObject
{
public:
    // typedefs

    typedef Poco::AutoPtr<TCPServerParams> Ptr;

    // methods

    void
    setThreadIdleTime(const Poco::Timespan& idleTime);

    const Poco::Timespan&
    getThreadIdleTime() const;

    void
    setMaxQueued(int count);

    int
    getMaxQueued() const;

    void
    setMaxThreads(int count);

    int
    getMaxThreads() const;

    void
    setThreadPriority(Poco::Thread::Priority prio);

    Poco::Thread::Priority
    getThreadPriority() const;
};

// direct descendants

class HTTPServerParams;

Inherited Members

public:
    // methods

    void
    duplicate() const;

    void
    release() const;

    int
    referenceCount() const;

Detailed Documentation

This class is used to specify parameters to both the TCPServer, as well as to TCPServerDispatcher objects.

Subclasses may add new parameters to the class.

Construction

virtual
~TCPServerParams()

Destroys the TCPServerParams.

Methods

void
setThreadIdleTime(const Poco::Timespan& idleTime)

Sets the maximum idle time for a thread before it is terminated.

The default idle time is 10 seconds;

const Poco::Timespan&
getThreadIdleTime() const

Returns the maximum thread idle time.

void
setMaxQueued(int count)

Sets the maximum number of queued connections.

Must be greater than 0.

If there are already the maximum number of connections in the queue, new connections will be silently discarded.

The default number is 64.

int
getMaxQueued() const

Returns the maximum number of queued connections.

void
setMaxThreads(int count)

Sets the maximum number of simultaneous threads available for this TCPServerDispatcher.

Must be greater than or equal to 0. If 0 is specified, the TCPServerDispatcher will set this parameter to the number of available threads in its thread pool.

The thread pool used by the TCPServerDispatcher must at least have the capacity for the given number of threads.

int
getMaxThreads() const

Returns the maximum number of simultaneous threads available for this TCPServerDispatcher.

void
setThreadPriority(Poco::Thread::Priority prio)

Sets the priority of TCP server threads created by TCPServer.

Poco::Thread::Priority
getThreadPriority() const

Returns the priority of TCP server threads created by TCPServer.