Use async iostream in place of python socket