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 | |
from asyncio import AbstractEventLoop | |
import socket | |
import logging | |
import signal | |
from typing import List | |
async def echo(connection: socket, loop: AbstractEventLoop) -> None: | |
try: |
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 selectors | |
import socket | |
from selectors import SelectorKey | |
from typing import List, Tuple | |
selector = selectors.DefaultSelector() | |
server_socket = socket.socket() | |
server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) |