socket_read() returns only headers, not the actual response
<p>I'm running</p>

<pre><code>$data = socket_read($socket, 2048, PHP_BINARY_READ);
</code></pre>

<p>that should return a string like this</p>

<pre><code>// $data == ' 1840 kg G 008765 A '
</code></pre>

<p>but instead it returns</p>

<pre><code>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
</code></pre>

<p>which is looks like headers of the data returned.</p>

<p>socket_send is configured correctly, we have other clients with same settings and they return correct values.</p>

<p>Can you please say what's the problem, and why i'm not getting expected string?</p>

<p>UPDATE:</p>

<p>I repeated socket_read() multiple times to read full string it it is:</p>

<pre><code>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
&lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;NPort Web Console&lt;/TITLE&gt;&lt;/HEAD&gt; &lt;FRAMESET rows=57,1* frameborder=NO&gt; &lt;FRAME name=top scrolling=NO target=contents src=top.htm noresize&gt; &lt;FRAMESET cols=200,*&gt; &lt;FRAME name=contents target=main src=contents.htm&gt; &lt;FRAME name=main src=main.htm marginwidth=0 marginheight=0 scrolling=auto&gt; &lt;/FRAMESET&gt; &lt;NOFRAMES&gt;&lt;BODY background=bg.gif&gt;&lt;P&gt;This page uses frame, but your browser doesn't support.&lt;/P&gt;&lt;/BODY&gt; &lt;/NOFRAMES&gt; &lt;/FRAMESET&gt;&lt;/HTML&gt;
</code></pre>

<p>so it's look like it returns some different things, that are suppose to be read by other program.</p>