Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I have these two programs where the server is run (2nd pic) and waits for the 1st program to run which sends it a 'hello
I have these two programs where the server is run (2nd pic) and waits for the 1st program to run which sends it a 'hello world' message before they both close. I'd like to have them changed so they can constantly be sending each other messages, maybe taking input from the terminal and when something is typed, is sent to the other one. Or if that is not possible, then just have one constantly sending to the other instead of both doing so.
import socket tcpip= '192.168.1.6' tcp-port 62 bufsize = 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 () import socket tcpip= '192.168.1.6' tcp-port 62 bufsize = 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 ()Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started