If you only want to disable linger there is a simpler option SO_DONTLINGER  
But make sure you will perform graceful shutdown as Raul had
mentioned.

Вт, 11 мар 2014, bill lam писал(а):
> I didn't read jforc. You probably need a linger structure.
> 
> * 
> http://msdn.microsoft.com/en-us/library/windows/desktop/ms740476(v=vs.85).aspx
> 
> http://msdn.microsoft.com/en-us/library/windows/desktop/ms740476(v=vs.85).aspx
> Пн, 10 мар 2014, Pascal Jasmin писал(а):
> > I found some example code for SO_LINGER in JforC, but I don't know if it is 
> > outdated, or does not work for osx:
> > 
> > first the exact example:
> > 
> > sdcheck_jsocket_ sdsetsockopt 0, SOL_SOCKET_jsocket_,SO_LINGER_jsocket_, 1 
> > 66
> > 
> > fails due to length error 5 params for 4 expected.
> > 
> > but other attempts also fail including:
> > sdcheck_jsocket_ sdsetsockopt_jsocket_ 0, 
> > SOL_SOCKET_jsocket_,SO_LINGER_jsocket_, 1
> > 
> > sdcheck_jsocket_ sdsetsockopt_jsocket_ 0, 
> > SOL_SOCKET_jsocket_,SO_LINGER_jsocket_, 0
> > 
> > 
> > The latter corresponds to the value of sdgetsockopt.
> > 
> > There is exception handling code for SO_LINGER in set and get sockopt.  Is 
> > the issue I am having osx specific?
> > 
> > sdsetsockopt=: 3 : 0
> > 's lev name val'=. y
> > if. name -: SO_LINGER do. val=. 65536 65536#.val end.
> > rc0 setsockoptJ s;lev;name;(,val);4
> > )
> > 
> > 
> > 
> > there i
> > 
> > 
> > ----- Original Message -----
> > From: Pascal Jasmin <[email protected]>
> > To: "[email protected]" <[email protected]>
> > Cc: 
> > Sent: Monday, March 10, 2014 3:30:53 PM
> > Subject: Re: [Jprogramming] sdcleanup_jsocket_ on osx
> > 
> > thank you for pointing this out.
> > 
> > While trying to make a reset verb, I can't seem to set this option:
> > 
> > cocurrent 'jsocket'
> > 
> > sdreset =: 3 : 0
> > pD v=. sdcheck sdgetsockopt 0; SOL_SOCKET_jsocket_;SO_LINGER_jsocket_
> > pD sdcheck sdsetsockopt 0;SOL_SOCKET_jsocket_;SO_LINGER_jsocket_;  1 0
> > pD sdcleanup_jsocket_ ''
> > pD sdsetsockopt 0;SOL_SOCKET_jsocket_;SO_LINGER_jsocket_; v
> > )
> > 
> > 
> > The first line returns ,< 0 0
> > 
> > its not clear how to pass the shape component in the 2nd line, but at any 
> > rate, I generate EINVAL errors no matter what I try to pass in set option, 
> > including 0 0 or ,< 0 0.
> > 
> > Could you please help in how to call sdsetsockopt for SO_LINGER?
> > 
> > ----- Original Message -----
> > From: bill lam <[email protected]>
> > To: [email protected]
> > Cc: 
> > Sent: Monday, March 10, 2014 10:57:56 AM
> > Subject: Re: [Jprogramming] sdcleanup_jsocket_ on osx
> > 
> > This is socket linger timeout, a feature not a bug. you may set tcp option
> > to disable it but I guess it is there for a good reason.
> > On Mar 10, 2014 10:51 PM, "Pascal Jasmin" <[email protected]> wrote:
> > 
> > > actually, an idle loop doesn't always free up resources.  Though load
> > > 'socket' seems to reset it.
> > >
> > >
> > > ----- Original Message -----
> > > From: Pascal Jasmin <[email protected]>
> > > To: "[email protected]" <[email protected]>
> > > Cc:
> > > Sent: Monday, March 10, 2014 10:31:53 AM
> > > Subject: [Jprogramming] sdcleanup_jsocket_ on osx
> > >
> > > sdcleanup_jsocket_ '' on windows will close all sockets correctly.  On
> > > OSX, it seems to require going to idle loop before any reuse of previous
> > > sockets (listen) is done.
> > >
> > > ----------------------------------------------------------------------
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> > 
> > > ----------------------------------------------------------------------
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> > 
> > >
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> > 
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> > ----------------------------------------------------------------------
> > 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
> gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to