Hi all
I'm trying to comunicate with a server thru TCP! this server is gateway for a bank! So i'm sending the gateway an ascii string and the server should send back a response with an eror or acceptance!
The problem is that when the user clicks the Send button the pages starts loading and sometimes its really fast and works flawlessly but other times its slow as if nothing happened so the clients press the send button again! this usually results in a double payment!
I'm not sure if the problem lies within the way i'm sending and receiing or else rom the payment people!
I'm using this method to send and receive the data:
Could it be that the above code is not effecient enough or? Can you suggest something more effecient than this!
Thanks
Ncik
I'm trying to comunicate with a server thru TCP! this server is gateway for a bank! So i'm sending the gateway an ascii string and the server should send back a response with an eror or acceptance!
The problem is that when the user clicks the Send button the pages starts loading and sometimes its really fast and works flawlessly but other times its slow as if nothing happened so the clients press the send button again! this usually results in a double payment!
I'm not sure if the problem lies within the way i'm sending and receiing or else rom the payment people!
I'm using this method to send and receive the data:
Code:
$fp = fsockopen ("xxx.xxx.xxx.xxx",xxxx, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, $crypted);
$Result = fgets ($fp,1024);
fclose ($fp);
}
Could it be that the above code is not effecient enough or? Can you suggest something more effecient than this!
Thanks
Ncik