MCPcopy
hub / github.com/tornadoweb/tornado / send_message

Function send_message

demos/tcpecho/client.py:12–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11
12async def send_message():
13 stream = await TCPClient().connect(options.host, options.port)
14 await stream.write((options.message + "\n").encode())
15 print("Sent to server:", options.message)
16 reply = await stream.read_until(b"\n")
17 print("Response from server:", reply.decode().strip())
18
19
20if __name__ == "__main__":

Callers 1

client.pyFile · 0.85

Calls 4

TCPClientClass · 0.90
read_untilMethod · 0.80
connectMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected