Skip to content

Instantly share code, notes, and snippets.

@castaneai
Created July 24, 2014 12:49
Show Gist options
  • Save castaneai/e110dd0d49a8cbf6548c to your computer and use it in GitHub Desktop.
Save castaneai/e110dd0d49a8cbf6548c to your computer and use it in GitHub Desktop.
requires python >= 3.4
import asyncio
def on_accept(r, w):
print("new client accepted.")
print(r, w)
if __name__ == "__main__":
future = asyncio.start_server(on_accept, host="127.0.0.1", port=5555)
asyncio.async(future)
asyncio.get_event_loop().run_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment