MCPcopy
hub / github.com/aceld/zinx / AddCloseCallback

Method AddCloseCallback

znet/kcp_connection.go:607–614  ·  view source on GitHub ↗
(handler, key interface{}, f func())

Source from the content-addressed store, hash-verified

605}
606
607func (s *KcpConnection) AddCloseCallback(handler, key interface{}, f func()) {
608 if s.isClosed() {
609 return
610 }
611 s.closeCallbackMutex.Lock()
612 defer s.closeCallbackMutex.Unlock()
613 s.closeCallback.Add(handler, key, f)
614}
615
616func (s *KcpConnection) RemoveCloseCallback(handler, key interface{}) {
617 if s.isClosed() {

Callers

nothing calls this directly

Calls 2

isClosedMethod · 0.95
AddMethod · 0.65

Tested by

no test coverage detected