I'm working with sockets 2 different folders on computers. I'm creating a basic TFTP client/server program. My code is as follows:
def RRQ (filename):
format = "!H%ds" % (len(filename)+1)
format += "%ds" % (len(mode)+1)
s = struct.pack(format, 1, filename, "octet")
return s
I have to say that I've copied it from another web if somebody has any other way to do it more simply pls show me. What I would like to know is once the WRQ or RRQ (both are the same code) is sent how does the server know the format to unpack?
Question: You receive the RRQ from client to server then you have to unpack on server to know the filename but how I could know the format on server to unpack?
thank you guys and sorry for my english :)