Think about Loose Coupling | |
PerlMonks |
client server file transferby Boots111 (Hermit) |
on Jun 23, 2001 at 00:55 UTC ( [id://90861]=perlquestion: print w/replies, xml ) | Need Help?? |
Boots111 has asked for the wisdom of the Perl Monks concerning the following question:
So I spent the last few hours trying to figure out how to get my client-server system (which now uses sockets) to transfer files. The final results is: For the server: and for the client: Originally I tried to do this without the little END tag; however that produced odd results. The client would seem to hang until the server was killed, at which point the client would recieve the file. Because I didn't know whether this one was should happen or not, I wrote the following test program: This program copies the file specified in its first agrument. Moreover this program works perfectly. Then I guessed that maybe (due to the client-server system) there was no way to specify that I had finished sending the binary output, so I added a newline character where the END tag currently is. That had the unfortunate result of sending will more then triple the actual file size to the program. Thus I came up with the END tag you see here. My question is: "Why did that stuff happen?" Am I missing some fundamental concept? Thanks, Boots
Back to
Seekers of Perl Wisdom
|
|