Question: Client: tcp_ip = '192.168.1.6' tcp_port = 62 buf_size = 1024 msg = Hello, World! b = bytearray() b.extend(map(ord, msg)) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((tcp_ip, tcp_port))

Client:

tcp_ip = '192.168.1.6' tcp_port = 62 buf_size = 1024 msg = "Hello, World!" b = bytearray() b.extend(map(ord, msg))

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((tcp_ip, tcp_port)) s.send(b) s.close()

Server:

tcp_ip = '192.168.1.6' tcp_port = 5005 buf_size = 20

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((tcp_ip, tcp_port)) s.listen(1)

conn, addr = s.accept() print ('Connection address:', addr) while 1: data = conn.recv(buf_size) if not data: break print ("received data:", data) conn.close()

How can i change one of these programs so more than just the one "hello message" is sent. Make it so multiple messages can be sent

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!