Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming Languages 12th International Symposium Dbpl 2009 Lyon France August 2009 Proceedings Lncs 5708

Authors: Philippa Gardner ,Floris Geerts

2009th Edition

3642037925, 978-3642037924

More Books

Students also viewed these Databases questions

Question

4. Identify how culture affects appropriate leadership behavior

Answered: 1 week ago

Question

1. Prepare a flowchart of Dr. Mahalees service encounters.

Answered: 1 week ago