[Mono-dev] fix for bug #358987 in 1.9?

Avery Pennarun apenwarr at gmail.com
Wed Feb 20 11:37:57 EST 2008


2008/2/20 Steve Bjorg <steveb at mindtouch.com>:
> - s.Shutdown (SocketShutdown.Both);
> + try {
> + s.Shutdown (SocketShutdown.Both);
> + } catch(Exception e) {
> + // log here?
> + }
>   s.Close ();

Why call Shutdown() at all?  The shutdown syscall is only useful if
you need to keep the fd around longer (eg. if someone else is still
holding onto it and you don't want it to be reused).  In the above
code, close() shuts down the socket anyway.

...unless mono's socket code is doing something different than
standard C sockets, that is.

Have fun,

Avery


More information about the Mono-devel-list mailing list