use conn.Close instead of send value to channel

master
fangdingjun 6 years ago
parent a360f286b0
commit e722eded24

@ -306,14 +306,7 @@ func onStreamClose(ptr unsafe.Pointer, streamID C.int) C.int {
func onConnectionCloseCallback(ptr unsafe.Pointer) { func onConnectionCloseCallback(ptr unsafe.Pointer) {
conn := (*Conn)(unsafe.Pointer(uintptr(ptr))) conn := (*Conn)(unsafe.Pointer(uintptr(ptr)))
conn.err = io.EOF conn.err = io.EOF
conn.Close()
// signal all goroutings exit
for i := 0; i < 6; i++ {
select {
case conn.exitch <- struct{}{}:
default:
}
}
} }
//export onStreamEndCallback //export onStreamEndCallback

Loading…
Cancel
Save