Advertisement

sending files [p2p]

Started by November 24, 2002 04:12 PM
1 comment, last by zackriggle 22 years, 2 months ago
Alright, how would I go about doing this [assuming a binary file].... would I open the file, read a bit, send it, read a bit, send it... and so no, while the recipient receives, writes, receives, write... and so on....
Yes, but don''t forget to check for errors, while sending/recieving each piece.
Advertisement
Ok, we have computer A and B. File goes from B to A.

* Computer A listen to a socket
* Computer B connects to computer A''s socket
* Computer A selects() the connection.
* B sends a length-of-file line
* A says "OK, carry on"
* B reads and sends the damn file
* A recieves the file.
* When A has gotten all of the file, he tells B: "Thanks alot for that crap, now go hang yourself" *click*
* B doesn''t know what to do, and commit suicide.

...sorry, I''m tired

This topic is closed to new replies.

Advertisement