12-28-2016, 09:28 PM
(12-28-2016, 05:55 PM)qwerasd205 Wrote:(12-28-2016, 09:48 AM)Apuly Wrote: all fine and dandy that you use the pings to see if there's a connection, but you can cut those out completely, and have the request function as ping request as well.
and to be frank I really don't see the use in sending multiple ping packets before opening a connection. if a host can't be reached, it won't receive ping packets in the first place.
You seem to be expecting 100% reliability and no packet drops. A makes sure it can connect to B and B makes sure it can connect to A, then the connection continues. Also, you seem to have conglomerated your protocol request and the packet naming the type of protocol, this dramatically reduces your potential request and protocol type data space and so, looking in to the future is a poor idea.
Failure on A-side
A: This is a protocol request for protocol X
packet dropped....
A: This is a protocol request...
If this doesn't answer after X tries, B is not online or not reachable.
Failure on B-side
A: This is a protocol request for protocol X
B: Affirmative
packet dropped between B and A...
Now B doesn't know whether A has recieved and answered, but his packet was lost, or the packet of B was lost. The protocol will have to decide who tries to send first. But the same problem exist after pings have happened.
Your ping's are not smaller than the protocol request, or any other data packet.