Answer the question
In order to leave comments, you need to log in
Acknowledging receipt of a packet by a TCP server in docker?
Hello!
There is a simple TCP server in Python running in Docker (an example from the documentation of the socketserver library ).
import socketserver
class MyTCPHandler(socketserver.BaseRequestHandler):
def handle(self):
self.data = self.request.recv(1024)
print("{} wrote:".format(self.client_address[0]))
self.request.sendall(подтвеждение)
if __name__ == "__main__":
HOST, PORT = "localhost", 9999
with socketserver.TCPServer((HOST, PORT), MyTCPHandler) as server:
server.serve_forever()
b"\x01.\x80\x01\x82\x02\x15\x03867459044383263\x042\x00\x10\x00\x00 \xae|\xa5]0 \x8f\xdaR\x03\xdf\xc5=\x023\x00\ x00\x00\x00A'"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question