class SendContent(Protocol):

    def connectionMade(self):
        self.transport.write(self.factory.text)
self.transport.loseConnection()


class SendContentFactory(Factory):
    protocol = SendContent

def __init__(self, text=None):
    if text is None:
        text = 'Hello, how are you my friend? Feeling fine? Good!'
self.text = text
Несколько одновременных сетевых подключений — сервер Telnet, Python