I'm trying to work out how to set a timeout for the [Net->connect] tag.
With the TCP_open tags there was a timeout parameter but with Net- >Connect it doesnt seem possible to change this from the default (60 seconds?) I may need to increase or reduce this timeout depending on my particular application. I'm testing this by trying to connect to a non-existent IP address on our subnet. i.e. var:'myConnection'=(net); $myConnection->(Connect: '192.168.0.11', 80); Can anyone point me in the right direction? Al Fleming --------------------------------------------- 430am Ltd. Tel: +44 (0)1543 473333 Fax: +44 (0)1543 473335 --------------------------------------------- -- ------------------------------ Lasso Support: http://support.omnipilot.com/ Search the list archives: http://www.listsearch.com/lassotalk.lasso Manage your list subscription: http://www.listsearch.com/lassotalk.lasso?manage |
On Jun 1, 2005, at 2:50 PM, Al Fleming wrote: > I'm trying to work out how to set a timeout for the [Net->connect] > tag. > With the TCP_open tags there was a timeout parameter but with Net- > >Connect it doesnt seem possible to change this from the default > (60 seconds?) > I may need to increase or reduce this timeout depending on my > particular application. > > I'm testing this by trying to connect to a non-existent IP address > on our subnet. > > i.e. > var:'myConnection'=(net); > $myConnection->(Connect: '192.168.0.11', 80); > > Can anyone point me in the right direction? The only example of using the net type in the online LDML ref shows exactly how to do this. Here is another example. This one will wait 12 seconds for a connection to localhost, then ask for the default HTTP document and output the first up to 4000 chars: local('net' = net); if (#net->setBlocking(false) & connect('127.0.0.1', 80) & wait(12, net_waitwrite) == net_waitwrite); #net->setBlocking(true) & write('GET / HTTP/1.0\r\n\r\n') & read (4000); /if; handle; #net->close; /handle; -K -- ------------------------------ Lasso Support: http://support.omnipilot.com/ Search the list archives: http://www.listsearch.com/lassotalk.lasso Manage your list subscription: http://www.listsearch.com/lassotalk.lasso?manage |
In reply to this post by Al Fleming
Thanks for this. I'll give it a try.
For what its worth, I couldnt get the example in the LDML ref to work: With setblocking set to false, the first Fail_If was kicking in every time - you might want to have a look and see if its just me or whether the example needs updating. On Wed, 1 Jun 2005 15:35:54 -0400 Kyle Jessup <[hidden email]> wrote: > >On Jun 1, 2005, at 2:50 PM, Al Fleming wrote: > >> I'm trying to work out how to set a timeout for the >>[Net->connect] >> tag. >> With the TCP_open tags there was a timeout parameter but >>with Net- >> >Connect it doesnt seem possible to change this from the >>default >> (60 seconds?) >> I may need to increase or reduce this timeout depending >>on my >> particular application. >> >> I'm testing this by trying to connect to a non-existent >>IP address >> on our subnet. >> >> i.e. >> var:'myConnection'=(net); >> $myConnection->(Connect: '192.168.0.11', 80); >> >> Can anyone point me in the right direction? > >The only example of using the net type in the online LDML >ref shows exactly how to do this. > >Here is another example. This one will wait 12 seconds >for a connection to localhost, then ask for the default >HTTP document and output the first up to 4000 chars: > >local('net' = net); >if (#net->setBlocking(false) & connect('127.0.0.1', 80) & >wait(12, net_waitwrite) == net_waitwrite); > #net->setBlocking(true) & write('GET / >HTTP/1.0\r\n\r\n') & read >(4000); >/if; >handle; > #net->close; >/handle; > >-K > >-- >------------------------------ >Lasso Support: http://support.omnipilot.com/ >Search the list archives: >http://www.listsearch.com/lassotalk.lasso >Manage your list subscription: > http://www.listsearch.com/lassotalk.lasso?manage -- ------------------------------ Lasso Support: http://support.omnipilot.com/ Search the list archives: http://www.listsearch.com/lassotalk.lasso Manage your list subscription: http://www.listsearch.com/lassotalk.lasso?manage |
Free forum by Nabble | Edit this page |