FAQ
Reviewers: dfc,

Message:
Hello dave@cheney.net (cc: golang-dev@googlegroups.com),

I'd like you to review this change to
https://go.googlecode.com/hg/


Description:
net: change windows netFD finalizer to behave similar to unix

Please review this at https://codereview.appspot.com/6873046/

Affected files:
M src/pkg/net/fd_windows.go


Index: src/pkg/net/fd_windows.go
===================================================================
--- a/src/pkg/net/fd_windows.go
+++ b/src/pkg/net/fd_windows.go
@@ -300,7 +300,6 @@
net: net,
closec: make(chan bool),
}
- runtime.SetFinalizer(netfd, (*netFD).Close)
return netfd
}

@@ -319,6 +318,7 @@
func (fd *netFD) setAddr(laddr, raddr Addr) {
fd.laddr = laddr
fd.raddr = raddr
+ runtime.SetFinalizer(fd, (*netFD).closesocket)
}

func (fd *netFD) connect(ra syscall.Sockaddr) error {
@@ -398,6 +398,10 @@
return fd.shutdown(syscall.SHUT_WR)
}

+func (fd *netFD) closesocket() error {
+ return closesocket(fd.sysfd)
+}
+
// Read from network.

type readOp struct {

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupgolang-dev @
categoriesgo
postedDec 4, '12 at 11:22p
activeDec 4, '12 at 11:22p
posts1
users1
websitegolang.org

1 user in discussion

Alex Brainman: 1 post

People

Translate

site design / logo © 2022 Grokbase