Created
July 24, 2014 12:49
-
-
Save castaneai/e110dd0d49a8cbf6548c to your computer and use it in GitHub Desktop.
requires python >= 3.4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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