I'd like to make a chatting program using win socket in c/c++. (I am totally newbie.) The first question is about how to check if the client receives packets from server. For instance, a server sends "aaaa" to a client. And if the client doesn't receive packet "aaaa", the server should re-send the packet again.(I think). However, I don't know how to check it out. Here is my thought blow. First case.
Server --- "aaaa" ---> Client.
Server will be checking a sort of time waiting confirm msg from the client.
Client --- "I received it" ---> Server.
Server won't re-send the packet.
The other case.
Server --- "aaaa" ---> Client.
Server is waiting for client msg until time out
Server --- "aaaa" ---> Client again.
But these are probably inappropriate. Look at second case. Server is waiting a msg from client for a while. And if time's out, server will re-send a packet again. In this case, client might receive the packet twice.
Second question is how to send unlimited size packet. A book says packet should have a type, size, and msg. Following it, I can only send msg with the certain size. But i want to send msg like 1Mbytes or more.(unlimited)
How to do that?
Anyone have any good link or explain correct logic to me as easy as possible.
Thanks.