Thanks ,
I think so,DontLinger not take a LingerOption
but the follow is come from msdn
/*
To set the DontLinger socket option to false, create a LingerOption, set
the enabled property to false, and set the LingerTime property to the
desired time out period. Use this LingerOption along with the DontLinger
socket option to call the SetSocketOption method.
*/
Maybe document error?
"Jon Skeet [C# MVP]" <sk***@pobox.com> ????
news:MP************************@msnews.microsoft.c om...
L.J.SONG <Bc**********@hotmail.com> wrote: Anybody had ever used this statement?
/////
SetSocketOption(SocketOptionLevel.Socket,SocketOpt ionName,DontLinger,new
LingerOption(false,0))
////
Whernver I use this will got a excption only has a message read
"OptionValue"
I would expect DontLinger to *not* take a LingerOption. Try passing
null instead, or use the version which takes an integer (passing 1, I
presume). I'd expect SocketOptionName.Linger to take a LingerOption
value.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too