Xiao Jia's Blog

Learning Poco: List directories recursively

September 14th 2011

In this tutorial, we will write a simple utility program for listing directories recursively. Poco provides DirectoryIterator to iterate over all the items contained in a directory. We will also make use of DateTimeFormatter to format the last-modified timestamp in our local time zone instead of the default UTC. This utility mimics the behavior of ls -all

Learning Poco: Getting started with threads

September 13th 2011

In this tutorial, we will write a very simple example for getting started with threads. Poco provides abstraction for threads of many platforms and systems. We first need to implement our own Runnable worker class, then create a Thread and start the worker…

Learning Poco: Load XML Configuration

September 12th 2011

In this tutorial, we will load XML configuration from the filesystem by using XMLConfiguration, and access specific configuration items by using methods provided by AbstractConfiguration. Here, AbstractConfiguration is an interface, and XMLConfiguration is the implementation, both provided by Poco…

Learning Poco: A simple HTTP server

September 11th 2011

In this tutorial, we will write a simple HTTP server by using useful components provided by Poco.

For listening on a specific port, we need a HTTPServer and pass a ServerSocket and a HTTPRequestHandlerFactory to its constructor. Once a request is accepted, a new thread is created (possibly from a pool) to serve it. For serving a request, the HTTPRequestHandlerFactory is responsible to create a HTTPRequestHandler to handle it. After the request is served, the corresponding HTTPRequestHandler is destroyed…

Learning Poco: GET with HTTP

September 10th 2011

Poco is a modern, powerful open source C++ class libraries and frameworks for building network- and internet-based applications that run on desktop, server and embedded systems. It is well-documented but still lacks some tutorials. This article starts the series of tutorials for learning Poco. In this article, we will GET some web resource with HTTP…

Hello pthread and ucontext!

September 5th 2011

These two programs are hello-world examples for pthread and ucontext. Both of them are related to my recent work. If you want to understand these two programs better, you may compile them by yourself and run them. Hope they will give you a general idea about how program looks when working with pthread and ucontext. I will try to combine these two technologies together and possibly make something interesting in the future…

RSS Feed Fork me on GitHub