Let's assume this is being executed in jQuery:
$.ajax({
url : 'ajaxcall.php',
data : { 'data' : { ary : [1,2,3,3,4,5], txt : "ima let u finish" } },
dataType : 'json',
type : 'post',
timeout : 10000
});
And ajaxcall.php contains:
$return_obj = array();
$return_obj['ary'] = array(9,8,7,6,5);
$return_obj['txt'] = "ok then";
echo json_encode($return_obj);
die();
I'm expecting the following situations to occur (due to packet loss, connection problems, etc):
However, what I'm really worried about are situations like these:
Are these situations possible?
In short: no, that's not possible. HTTP is based on TCP which guarantees delivery of data. Both the server and client would be aware of an issue that would cause some data to be missed. The TCP layer would retransmit the data as needed until it is complete.
Packet loss and out of order delivery are not uncommon the internet since there is no rule that says routers must forward all packets but TCP automatically corrects for those issues.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With