The keyword you missed is stress. Run some jobs to comsume nearly
all of the network bandwidth. This is not specific to J, but it
is the way how socket programming works in general.
Вс., 27 янв. 2013, Bob Miller писал(а):
> In jconsole(line by line) it works just fine, i cannot see why it should fail
> in script mode(when executing "jconsole file").
> Can you suggest how can experiment with it?
>
>
> Line by line xecution:
> -----------------------------------
> localhost: jconsole
> load 'socket'
> coinsert 'jsocket'
> ]socket =: 0 pick sdcheck sdsocket ''
> 4
> ]jsoft =: sdcheck sdgethostbyname 'www.jsoftware.com'
> ┌─┬───────────┐
> │2│23.21.67.48│
> └─┴───────────┘
> ]sdcheck sdconnect socket ; jsoft , < 80
>
> ]sdcheck ('GET /',CR,LF) sdsend socket,0
> ┌─┐
> │7│
> └─┘
> data =: ;sdcheck sdrecv socket , 10000000 , 0
> #data
> 5121
> sdcheck sdclose socket
> -----------------------------------
>
> Script execution:
> -----------------------------------
> localhost: cat test.ijs
> load 'socket'
> coinsert 'jsocket'
>
> socket =: 0 pick sdcheck sdsocket ''
> jsoft =: sdcheck sdgethostbyname 'www.jsoftware.com'
> sdcheck sdconnect socket ; jsoft , < 80
> sdcheck ('GET /',CR,LF) sdsend socket,0
> data =: ;sdcheck sdrecv socket , 10000000 , 0
> sdcheck sdclose socket
>
> localhost: jconsole test.ijs
> #data
> 1448
> -----------------------------------
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm