I run
$data = socket_read($socket, 2048, PHP_BINARY_READ);
which should return a string like this
// $data == ' 1840 kg G 008765 A '
but instead it returns
Original response: HTTP/1.1 200 OK Date: Wed, 19 Feb 2003 09:00:00 GMT Server: MoxaHttp/1.0 Pragma: no-cache Cache-Control: no-cache Content-type: text/html Content-length: 450
which looks like the headers of the returned data.
socket_send is configured correctly, we have other clients with the same settings, and they return the correct values.
Can you tell me what the problem is and why I am not getting the expected line?
UPDATE:
I repeated socket_read () several times to read the complete line that it:
Original response: HTTP/1.1 200 OK Date: Wed, 19 Feb 2003 09:00:00 GMT Server: MoxaHttp/1.0 Pragma: no-cache Cache-Control: no-cache Content-type: text/html Content-length: 450 Set-Cookie: ChallID=1656 <HTML><HEAD><TITLE>NPort Web Console</TITLE></HEAD> <FRAMESET rows=57,1* frameborder=NO> <FRAME name=top scrolling=NO target=contents src=top.htm noresize> <FRAMESET cols=200,*> <FRAME name=contents target=main src=contents.htm> <FRAME name=main src=main.htm marginwidth=0 marginheight=0 scrolling=auto> </FRAMESET> <NOFRAMES><BODY background=bg.gif><P>This page uses frame, but your browser doesn't support.</P></BODY> </NOFRAMES> </FRAMESET></HTML>
therefore, it looks like it is returning some other things that are supposed to be read by another program.
source share