The POCO C++ Libraries have been trusted by C++ developers worldwide for 19+ years to build challenging and mission-critical applications in a wide variety of industries.
Whether building automation systems, industrial automation, IoT platforms, air traffic management systems, enterprise IT application and infrastructure management, security and network analytics, automotive infotainment and telematics, financial or healthcare, C++ developers have deployed the POCO C++ Libraries in millions of devices.
See how Poco C++ Libraries are being used for machine learning in manufacturing! Implementing AI in manufacturing dramatically improves factory operations, reduces lead times, and eliminates delays. All thanks to the robust power of the POCO C++ Libraries, proving that anything is possible when you have the right know-how and technology to support your needs.
Create software for connected embedded devices running Linux, Windows IoT or QNX.
Create cross-platform backends in C++ for iOS and Android applications and combine it with a native or HTML5-based user interface.
Create software for IoT devices that talk to cloud backends over HTTP REST APIs. See macchina.io EDGE for an IoT edge platform built with POCO.
Build application servers in C++ that talk to various SQL databases, MongoDB or Redis.
Build high-performance microservices with REST APIs for data analytics or machine learning in C++.
Build desktop applications that talk to REST APIs or SQL databases.
Powerful platform abstractions let you build cross platform code that runs on all common desktop, server, mobile and embedded platforms.
Written in efficient modern C++, POCO does not waste precious CPU cycles and memory.
Comprehensive and consistent APIs combined with an easily accessible code base make C++ developers more productive.
Don't pay for what you don't use. Use on embedded Linux devices with as little as of 8-16 MB of RAM, or on multi-core, multi-gigabyte servers.
Advanced multithreading abstractions simplify the development of multithreaded programs.
Versatile, low overhead and extensible logging framework for all your logging needs.
Multiple APIs (streaming and document-oriented) for parsing and creating JSON and XML.
Access SQL databases like SQLite, MySQL/MariaDB, PostgreSQL and SQL Server (via ODBC). Or NoSQL databases like MongoDB and Redis.
From basic sockets to HTTP/HTTPS client and server, POCO covers all your network programming needs.
Easy-to-use wrappers for OpenSSL make it easy to integrate encryption and SSL/TLS into your application.
The following code example implements a simple multithreaded web server serving a single HTML page. It uses the Foundation, Net and Util libraries and shows the following features:
#include "Poco/Net/HTTPServer.h"
#include "Poco/Net/HTTPRequestHandler.h"
#include "Poco/Net/HTTPRequestHandlerFactory.h"
#include "Poco/Net/HTTPServerRequest.h"
#include "Poco/Net/HTTPServerResponse.h"
#include "Poco/Net/ServerSocket.h"
#include "Poco/Util/ServerApplication.h"
#include <iostream>
using namespace Poco;
using namespace Poco::Net;
using namespace Poco::Util;
using namespace std::string_literals;
class HelloRequestHandler: public HTTPRequestHandler
{
void handleRequest(HTTPServerRequest& request, HTTPServerResponse& response)
{
Application& app = Application::instance();
app.logger().information("Request from %s"s, request.clientAddress().toString());
response.setChunkedTransferEncoding(true);
response.setContentType("text/html"s);
response.send()
<< "<html>"
<< "<head><title>Hello</title></head>"
<< "<body><h1>Hello from the POCO Web Server</h1></body>"
<< "</html>";
}
};
class HelloRequestHandlerFactory: public HTTPRequestHandlerFactory
{
HTTPRequestHandler* createRequestHandler(const HTTPServerRequest&)
{
return new HelloRequestHandler;
}
};
class WebServerApp: public ServerApplication
{
void initialize(Application& self)
{
loadConfiguration();
ServerApplication::initialize(self);
}
int main(const std::vector<std::string>&)
{
UInt16 port = config().getUInt16("port"s, 8080);
HTTPServer srv(new HelloRequestHandlerFactory, port);
srv.start();
logger().information("HTTP Server started on port %hu."s, port);
waitForTerminationRequest();
logger().information("Stopping HTTP Server..."s);
srv.stop();
return Application::EXIT_OK;
}
};
POCO_SERVER_MAIN(WebServerApp)