[Tutor] transferring binary files over a network

Stephen Aichele aichele@mindspring.com
Sat, 21 Apr 2001 14:54:13 -0400 (EDT)


I have a couple newby networking questions here.

1.  In sending network events, I'm wondering just how they get delivered.  For example, I've set up two sockets, client and server, and the client is sending a file to the server.  What if the server doesn't want files larger than a certain size coming through or if it doesn't want to receive files from a particular client: how do I set up a protocol to deal with these situations??

2.  I've been tossing strings back and forth over my network connection, but now I'd like to move to binary files.  I'm guessing that I'm going to have to do something like:

a) open file for reading
b) readlines to python variable
c) send python variable over network to server
d) have server parse variable (ie, if it has a header describing filetype, etc..)

Does this sound about right, or am I missing something important here?