Refactor with blocking IO sockets.
Merge pull request #2 from Gnitset/blocking_sockets

Refactor with blocking IO sockets.