Revert "threaded server"

This reverts commit ce6da53f04547de7baa0856fa2d2536b54a2015a.
Revert "Revert "threaded server""

This reverts commit a61d8864886f27590b40a61e7b984449f555cce3.