The POCO C++ Libraries are being used by developers worldwide to build challenging and mission-critical applications.

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 trust in the POCO C++ Libraries.

POCO is Used For

Embedded Devices

Create software for connected embedded devices running Linux, Windows Embedded or QNX.

Mobile Apps

Create cross-platform backends in C++ for iOS and Android applications and combine it with a native or HTML5-based user interface.

Internet of Things

Create software for IoT devices that talk to cloud backends over HTTP REST APIs. See macchina.io for an IoT platform built with POCO.

Server Applications

Build application servers in C++ that talk to SQL databases, MongoDB or Redis.

Cloud & Microservices

Build high-performance microservices with REST APIs for data analytics or machine learning in C++.

Desktop

Build desktop applications that talk to REST APIs or SQL databases.

Main Features

Cross-Platform

Powerful platform abstractions let you build cross platform code that runs on all common desktop, server, mobile and embedded platforms.

Performance

Written in efficient modern C++, POCO does not waste precious CPU cycles and memory.

Easy to Use

Comprehensive and consistent APIs combined with an easily accessible code base make C++ developers more productive.

Modular & Scalable

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.

Multithreading

Advanced multithreading abstractions simplify the development of multithreaded programs.

Logging

Versatile, low overhead and extensible logging framework for all your logging needs.

JSON & XML

Multiple APIs (streaming and document-oriented) for parsing and creating JSON and XML.

Database Access

Access SQL databases like SQLite, MySQL/MariaDB, PostgreSQL and SQL Server (via ODBC). Or NoSQL databases like MongoDB and Redis.

Network & Internet

From basic sockets to HTTP/HTTPS client and server, POCO covers all your network programming needs.

Encryption & Security

Easy-to-use wrappers for OpenSSL make it easy to integrate encryption and SSL/TLS into your application.

From Our Blog

Example Code

Simple Web Server

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:

  • Cross-Platform - the code will work on all supported platforms, including Linux, macOS and Windows.
  • Logging
  • HTTP framework in Net library.
  • Server application support in Util library including configuration file handling.
#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;

class HelloRequestHandler: public HTTPRequestHandler
{
    void handleRequest(HTTPServerRequest& request, HTTPServerResponse& response)
    {
        Application& app = Application::instance();
        app.logger().information("Request from %s", request.clientAddress().toString());

        response.setChunkedTransferEncoding(true);
        response.setContentType("text/html");

        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 = static_cast<UInt16>(config().getUInt("port", 8080));

        HTTPServer srv(new HelloRequestHandlerFactory, port);
        srv.start();
        logger().information("HTTP Server started on port %hu.", port);
        waitForTerminationRequest();
        logger().information("Stopping HTTP Server...");
        srv.stop();

        return Application::EXIT_OK;
    }
};

POCO_SERVER_MAIN(WebServerApp)