Add support for multiple-connection threads

Support multiple connection threads / cpu.

Fixes #26