Question: 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

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

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!