<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Class Poco::Net::HTTPServer</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/> <meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/> <meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/> <meta name="language" content="en"/> <meta name="date" content="2009-11-24"/> <meta name="generator" content="PocoDoc"/> <link rel="stylesheet" href="css/styles.css" type="text/css"/> </head> <body bgcolor="#ffffff" leftmargin="0" topmargin="0"> <div class="header"> <h1 class="namespace"><a href="Poco.Net.html" class="namespace">Poco::Net</a></h1> <h1 class="symbol">class HTTPServer</h1> </div> <div class="body"> <p> <b>Library:</b> Net<br /> <b>Package:</b> HTTPServer<br /> <b>Header:</b> Poco/Net/HTTPServer.h</p> <h2>Description</h2> <div class="description"> <p>A subclass of <a href="Poco.Net.TCPServer.html" title="class Poco::Net::TCPServer">TCPServer</a> that implements a full-featured multithreaded HTTP server. </p> <p>A <a href="Poco.Net.HTTPRequestHandlerFactory.html" title="class Poco::Net::HTTPRequestHandlerFactory">HTTPRequestHandlerFactory</a> must be supplied. The <a href="Poco.Net.ServerSocket.html" title="class Poco::Net::ServerSocket">ServerSocket</a> must be bound and in listening state. </p> <p>To configure various aspects of the server, a <a href="Poco.Net.HTTPServerParams.html" title="class Poco::Net::HTTPServerParams">HTTPServerParams</a> object can be passed to the constructor. </p> <p>The server supports: </p> <ul> <li>HTTP/1.0 and HTTP/1.1 </li> <li>automatic handling of persistent connections. </li> <li>automatic decoding/encoding of request/response message bodies using chunked transfer encoding. </li> </ul> <p>Please see the <a href="Poco.Net.TCPServer.html" title="class Poco::Net::TCPServer">TCPServer</a> class for information about connection and thread handling. </p> <p>See <a href="http://www.ietf.org/rfc/rfc2616.txt" target="_blank">RFC 2616</a> <<a href="http://www.faqs.org/rfcs/rfc2616.html" target="_blank">http://www.faqs.org/rfcs/rfc2616.html</a>> for more information about the HTTP protocol. </p> </div> <h2>Inheritance</h2> <p><b>Direct Base Classes: </b><a href="Poco.Net.TCPServer.html" title="class Poco::Net::TCPServer">TCPServer</a></p> <p><b>All Base Classes: </b><a href="Poco.Net.TCPServer.html" title="class Poco::Net::TCPServer">TCPServer</a>, <a href="Poco.Runnable.html" title="class Poco::Runnable">Poco::Runnable</a></p> <h2>Member Summary</h2> <p><b>Inherited Functions: </b><a href="Poco.Net.TCPServer.html#15565" title="Poco::Net::TCPServer::currentConnections()">currentConnections</a>, <a href="Poco.Net.TCPServer.html#15563" title="Poco::Net::TCPServer::currentThreads()">currentThreads</a>, <a href="Poco.Net.TCPServer.html#15566" title="Poco::Net::TCPServer::maxConcurrentConnections()">maxConcurrentConnections</a>, <a href="Poco.Net.TCPServer.html#15560" title="Poco::Net::TCPServer::params()">params</a>, <a href="Poco.Net.TCPServer.html#15569" title="Poco::Net::TCPServer::port()">port</a>, <a href="Poco.Net.TCPServer.html#15567" title="Poco::Net::TCPServer::queuedConnections()">queuedConnections</a>, <a href="Poco.Net.TCPServer.html#15568" title="Poco::Net::TCPServer::refusedConnections()">refusedConnections</a>, <a href="Poco.Runnable.html#9810" title="Poco::Runnable::run()">run</a>, <a href="Poco.Net.TCPServer.html#15561" title="Poco::Net::TCPServer::start()">start</a>, <a href="Poco.Net.TCPServer.html#15562" title="Poco::Net::TCPServer::stop()">stop</a>, <a href="Poco.Net.TCPServer.html#15571" title="Poco::Net::TCPServer::threadName()">threadName</a>, <a href="Poco.Net.TCPServer.html#15564" title="Poco::Net::TCPServer::totalConnections()">totalConnections</a></p> <h2>Constructors</h2> <h3><a name="13028">HTTPServer</a></h3> <p class="decl"><a href="Poco.Net.HTTPServer.html" title="class Poco::Net::HTTPServer">HTTPServer</a>(<br /> <a href="Poco.Net.HTTPRequestHandlerFactory.html#12883" title="Poco::Net::HTTPRequestHandlerFactory::Ptr">HTTPRequestHandlerFactory::Ptr</a> pFactory,<br /> const <a href="Poco.Net.ServerSocket.html" title="class Poco::Net::ServerSocket">ServerSocket</a> & socket,<br /> <a href="Poco.Net.HTTPServerParams.html#13060" title="Poco::Net::HTTPServerParams::Ptr">HTTPServerParams::Ptr</a> pParams<br />);</p> <div class="description"> <p>Creates the <a href="Poco.Net.HTTPServer.html" title="class Poco::Net::HTTPServer">HTTPServer</a>, using the given <a href="Poco.Net.ServerSocket.html" title="class Poco::Net::ServerSocket">ServerSocket</a>. </p> <p>The server takes ownership of the HTTPRequstHandlerFactory and deletes it when it's no longer needed. </p> <p>The server also takes ownership of the <a href="Poco.Net.HTTPServerParams.html" title="class Poco::Net::HTTPServerParams">HTTPServerParams</a> object. </p> <p>News threads are taken from the default thread pool. </p> </div> <h3><a name="13032">HTTPServer</a></h3> <p class="decl"><a href="Poco.Net.HTTPServer.html" title="class Poco::Net::HTTPServer">HTTPServer</a>(<br /> <a href="Poco.Net.HTTPRequestHandlerFactory.html#12883" title="Poco::Net::HTTPRequestHandlerFactory::Ptr">HTTPRequestHandlerFactory::Ptr</a> pFactory,<br /> <a href="Poco.ThreadPool.html" title="class Poco::ThreadPool">Poco::ThreadPool</a> & threadPool,<br /> const <a href="Poco.Net.ServerSocket.html" title="class Poco::Net::ServerSocket">ServerSocket</a> & socket,<br /> <a href="Poco.Net.HTTPServerParams.html#13060" title="Poco::Net::HTTPServerParams::Ptr">HTTPServerParams::Ptr</a> pParams<br />);</p> <div class="description"> <p>Creates the <a href="Poco.Net.HTTPServer.html" title="class Poco::Net::HTTPServer">HTTPServer</a>, using the given <a href="Poco.Net.ServerSocket.html" title="class Poco::Net::ServerSocket">ServerSocket</a>. </p> <p>The server takes ownership of the HTTPRequstHandlerFactory and deletes it when it's no longer needed. </p> <p>The server also takes ownership of the <a href="Poco.Net.HTTPServerParams.html" title="class Poco::Net::HTTPServerParams">HTTPServerParams</a> object. </p> <p>News threads are taken from the given thread pool. </p> </div> <h2>Destructor</h2> <h3><a name="13037">~HTTPServer</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">~<a href="Poco.Net.HTTPServer.html" title="class Poco::Net::HTTPServer">HTTPServer</a>();</p> <div class="description"> <p>Destroys the <a href="Poco.Net.HTTPServer.html" title="class Poco::Net::HTTPServer">HTTPServer</a> and its <a href="Poco.Net.HTTPRequestHandlerFactory.html" title="class Poco::Net::HTTPRequestHandlerFactory">HTTPRequestHandlerFactory</a>. </p> </div> <p class="footer">POCO C++ Libraries 1.3.6-all<br /> Copyright © 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p> </div> </body> </html>