Hi,
I've got 2 questions about socket programming.
Background: I wrote a server/client chat-program for me and my friends using asynchronous TCP-sockets. Now I want to add a "file send"-option, that sends a file from one user to another (peer-o-peer), that should use a different socket on an different port than the chat. I intend to make the file transfer synchronous, so that no problems with multithreading can occur.
Now my questions:
A) Do TCP-sockets implement some type of error correction or error detection for the sent bytes or do I have to care about that by myself? File transfer is useless, if the file transfered is corrupted after receiving...
What error detection or correction mechanisms are fast enough to check each received packet, if I have to care about that?
B) What happens if a packet is lost or by some reason delayed and arriving after some of the following packets have already been received? Do I have to count the packets and care about their arrival order or do the sockets care about that for me?
In anyone could help me and answer these questions I would be very thankful.
- Fazzyer
I've got 2 questions about socket programming.
Background: I wrote a server/client chat-program for me and my friends using asynchronous TCP-sockets. Now I want to add a "file send"-option, that sends a file from one user to another (peer-o-peer), that should use a different socket on an different port than the chat. I intend to make the file transfer synchronous, so that no problems with multithreading can occur.
Now my questions:
A) Do TCP-sockets implement some type of error correction or error detection for the sent bytes or do I have to care about that by myself? File transfer is useless, if the file transfered is corrupted after receiving...
What error detection or correction mechanisms are fast enough to check each received packet, if I have to care about that?
B) What happens if a packet is lost or by some reason delayed and arriving after some of the following packets have already been received? Do I have to count the packets and care about their arrival order or do the sockets care about that for me?
In anyone could help me and answer these questions I would be very thankful.
- Fazzyer