This is an inherent quality of sockets, and the internet.

The internet is a packet switching system - messages get chopped up
into pieces and the pieces get sent independently.

And the socket system is a low level api which requires that the
programmer deal with this issue.

Exactly how you deal with that depends on what you are trying to accomplish.

In this case it looks like you are building an http client, so it's
fairly simple. If I recall correctly, you should be able to keep
reading the socket until it gives you an empty result. (If you had
nonblocking io enabled it would be a bit more involved, but it doesn't
look like you enabled nonblocking.)

Does this help you enough?

Thanks,

-- 
Raul



On Tue, Jul 28, 2015 at 4:55 PM, yves.tanguy <[email protected]> wrote:
>
> Hello All,
> i started J 1 week ago, and it is entousiamistic. sure it is better than
> APL.
>
> on win7/64-bits + J 803/64-bits
>
> i try this sample :
> load 'socket'
> coinsert 'jsocket'
>
> url =: 'abu.cnam.fr'
> page =: '/cgi-bin/donner_html?phedre2'
>
> sk =: 0 pick sdcheck sdsocket ''
> jsoft=: sdcheck sdgethostbyname url  NB. find host
> sdcheck sdconnect sk;jsoft,<80  NB. connect to port 80
> sdcheck [ ('GET ',page,CR,LF) sdsend sk,0
>
> txt =: sdcheck sdrecv sk,10000,0
>
> sdcheck sdclose sk
>
> my difficulty is here :
> i have the first 4096 characters of this page, never more.
> with other long textes pages, it is same problem.
>
> (under mac OS, i have only max 1000 chars)
>
>
> i need your helps to solve this.
>
> Great Thanks & Best Regards,
> Yves
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to