Exemple #1
0
def server(address):
    proto = Protocol()
    sock = proto.create_socket()
    sock.bind(address)
    file_requested, add = proto.listen(sock)
    # info = "Enjoyed minutes related as at on on. Is fanny dried as often me. Goodness as reserved raptures to mistaken steepest oh screened he. Gravity he mr sixteen esteems. Mile home its new way with high told said."
    proto.sendFile(sock, add, file_requested)
    return
Exemple #2
0
def client(address):
    proto = Protocol()
    sock = proto.create_socket()
    sock.bind(('localhost', 5000))
    recv = False
    while not recv:
        proto.connect(sock, address, 5, "trial2.txt")
        recv = proto.recvDataPackets(address, sock)
    return