VLxPain Posted September 4, 2010 Share Posted September 4, 2010 my current code: $host="127.0.0.1"; $port=7777; $timeout=5; $sk=fsockopen($host,$port,$errnum,$errstr,$timeout) ; if (!is_resource($sk)) { exit("connection fail: ".$errnum." ".$errstr) ; } else { fputs($sk, "idkxd") ; $dati="" ; while (!feof($sk)) { $dati.= fgets($sk, 256); } } fclose($sk); echo($dati); The problem is that when I send data to the server, I never get a response. I do not believe that this is a server side problem as it works through a c# application and as well as when I turn the application off. This is what happens when I do not shut the server off: 1. I run the Server 2. I run the php script 3. Data is sent from PHP 4. Server Responds 5. PHP never gets the response A slightly different way that it does respond to php: 1. I run the Server 2. I run the php script 3. Data is sent from PHP 4. Server Responds 5. I turn off the server application 6. PHP receives data from the server... Please help, I am kind of new with php sockets. Link to comment https://forums.phpfreaks.com/topic/212489-sockets-problem/ Share on other sites More sharing options...
VLxPain Posted September 4, 2010 Author Share Posted September 4, 2010 Please help, I know at least one of you knows... Link to comment https://forums.phpfreaks.com/topic/212489-sockets-problem/#findComment-1107347 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.