Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion file.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ func (f *win32File) closeHandle() {
_ = cancelIoEx(f.handle, nil)
f.wg.Wait()
// at this point, no new IO can start
windows.Close(f.handle)
if f.socket {
_ = windows.Closesocket(f.handle)
} else {
windows.Close(f.handle)
}
f.handle = 0
} else {
f.wgLock.Unlock()
Expand Down
7 changes: 7 additions & 0 deletions hvsock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,3 +671,10 @@ func mustBeType[T any](tb testing.TB, v any) T {
}
return v2
}
func TestHvSockFlagIsSet(t *testing.T) {
u := newUtil(t)
cl, sv, _ := clientServer(u)

u.Assert(cl.sock.socket, "Client win32File.socket should be true")
u.Assert(sv.sock.socket, "Server win32File.socket should be true")
}