Thanks for you reply!
Means yes, GC will close unused connection, just indirectly?  Cause I found 
this:
#/opt/go/src/net/fd_unix.go
func (fd *netFD) setAddr(laddr, raddr Addr) {
        fd.laddr = laddr
        fd.raddr = raddr
        runtime.SetFinalizer(fd, (*netFD).Close)
}

And this function is called by netFD.dial in sock_posix.go:148


在 2017年2月16日星期四 UTC+8下午3:31:07,Jan Mercl写道:
>
> On Thu, Feb 16, 2017 at 8:20 AM <casp...@gmail.com <javascript:>> wrote:
>
> > Will GC close unused connection ?
>
> No. At least not directly. A finalizer can possibly do that and finalizers 
> are possibly invoked by the GC.
>
> -- 
>
> -j
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to