mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-28 19:51:58 +01:00
ported 1.4.4 branch changes (needs build checks and test runs!)
This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
|
||||
#include "Poco/Net/Net.h"
|
||||
#include "Poco/SharedPtr.h"
|
||||
#include "Poco/BasicEvent.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
@@ -72,9 +73,15 @@ public:
|
||||
///
|
||||
/// Creates a new request handler for the given HTTP request.
|
||||
|
||||
protected:
|
||||
Poco::BasicEvent<const bool> serverStopped;
|
||||
|
||||
private:
|
||||
HTTPRequestHandlerFactory(const HTTPRequestHandlerFactory&);
|
||||
HTTPRequestHandlerFactory& operator = (const HTTPRequestHandlerFactory&);
|
||||
|
||||
friend class HTTPServer;
|
||||
friend class HTTPServerConnection;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -85,6 +85,19 @@ public:
|
||||
|
||||
~HTTPServer();
|
||||
/// Destroys the HTTPServer and its HTTPRequestHandlerFactory.
|
||||
|
||||
void stopAll(bool abortCurrent = false);
|
||||
/// Stops the server. In contrast to TCPServer::stop(), which also
|
||||
/// stops the server, but allows all client connections to finish at
|
||||
/// their pace, this allows finer control over client connections.
|
||||
///
|
||||
/// If abortCurrent is false, all current requests are allowed to
|
||||
/// complete. If abortCurrent is false, the underlying sockets of
|
||||
/// all client connections are shut down, causing all requests
|
||||
/// to abort.
|
||||
|
||||
private:
|
||||
HTTPRequestHandlerFactory::Ptr _pFactory;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "Poco/Net/HTTPResponse.h"
|
||||
#include "Poco/Net/HTTPRequestHandlerFactory.h"
|
||||
#include "Poco/Net/HTTPServerParams.h"
|
||||
#include "Poco/Mutex.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
@@ -70,10 +71,13 @@ public:
|
||||
|
||||
protected:
|
||||
void sendErrorResponse(HTTPServerSession& session, HTTPResponse::HTTPStatus status);
|
||||
void onServerStopped(const bool& abortCurrent);
|
||||
|
||||
private:
|
||||
HTTPServerParams::Ptr _pParams;
|
||||
HTTPRequestHandlerFactory::Ptr _pFactory;
|
||||
bool _stopped;
|
||||
Poco::FastMutex _mutex;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user