Commit d90cec4a authored by Suzhi Bi's avatar Suzhi Bi

Upload New File

parent 42efce26
import socket
import sys
def sender(ip, port):
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((ip, port))
except socket.error as msg:
print(msg)
sys.exit(1)
message = 'begin'
s.send(message.encode('utf-8'))
s.close()
destination_ip = ['192.168.191.5', '192.168.191.6', '192.168.191.7', '192.168.191.8']
port = [8081, 8082, 8083, 8084]
print ("Start")
for i in range(len(destination_ip)):
sender(destination_ip[i], port[i])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment