import socket import random sender = socket.socket(socket.AF_INET,socket.SOCK_STREAM) sender.bind((socket.gethostname(),100)) sender.listen(5) print("Waiting for a connection with the receiver") while True: client, address = sender.accept() print(f"Connection to {address} established") print("_______SENDER________") file = input("Enter a file name: ") msg = open(file,'r').read() data = list(msg) # number of packets y = len(data)//5 packets = [] #list of packets\ for x in range(y+1): packets.append(data[0:5]) del data[0:5]
CITATION STYLE
Nusairat, J. F. (2020). Server Side. In Rust for the IoT (pp. 33–90). Apress. https://doi.org/10.1007/978-1-4842-5860-6_2
Mendeley helps you to discover research relevant for your work.