a guest Mar 20th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- from socket import *
- import os
- IP_ADDR = 'localhost'
- PORT = 9090
- def sendBlock(nameoffile):
- sock = socket(AF_INET, SOCK_DGRAM)
- f = open(nameoffile,'rb')
- while True:
- data = f.readline()
- if (data == b''):
- sock.sendto(b'~EOF~',(IP_ADDR, PORT))
- sock.sendto(data, (IP_ADDR, PORT))
RAW Paste Data