async / sync socket framework in pure python