Topic: Wialon IPS Retranslator Packet Sending Probloem
hello gurtam team , i'm developed server which can listen port and receive data from Client... also i have packet sender (client side program it works fine)... now i retranslated data from wialon IPS retranslator.... LogIn request is coming and i give him answer (i'm using IPS EMULATOR for testing) but after answer i'm trying send #SD# packet but server can't receive it...(but if i send same #SD# data from my client side program it works fine)... what can i do? please response me
//Socket Create
$sock = socket_create(AF_INET, SOCK_STREAM, 0);
socket_bind($sock, $addr, $port) or die('Could not bind to address'); //Binding
socket_listen($sock);
do{
$client = socket_accept($sock);
$input = socket_read($client, 1024);
if($input == "exit"){ //For turning off server
socket_close($client);
socket_close($sock);
$con = 0;
}
else{
//X=777*Y=777;
//#AL#1\r\n
echo $input."<br>";
if(substr($input,0,3) == "#L#"){ //answer For Login packet
$request = "#AL#1\r\n";
socket_write($client, $request, strlen ($request)) or die("Could not write output\n");
}
if(substr($input,0,4) == "#SD#"){ //answer For #SD# date packet
$request = "#ASD#1\r\n";
socket_write($client, $request, strlen ($request)) or die("Could not write output\n");
}
}
}while($con == 1);