Question: Computer Networks: 1. Define a DC component and its effect on digital transmission. 2. Distinguish between a signal element and a data element 3. Use
Computer Networks:
1. Define a DC component and its effect on digital transmission. 2. Distinguish between a signal element and a data element 3. Use the client.py and server.py files and run them in your system (use two different terminals) and submit the snapshot of the successful connection. You can change the IP address, port number and the message.
client.py:
import socket client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client.connect(('0.0.0.0', 8080)) client.send("Hi there, let's be friends") from_server = client.recv(4096) client.close() print from_server
server.py:
import socket serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM) serv.bind(('0.0.0.0', 8080)) serv.listen(5) while True: conn, addr = serv.accept() from_client = '' while True: data = conn.recv(4096) if not data: break from_client += data print from_client conn.send("Sure, do you have something to tell me?") conn.close() print 'client disconnected'
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
