File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -102,15 +102,15 @@ type connection struct {
102
102
writeLock sync.Mutex
103
103
stateLock sync.RWMutex
104
104
readHandler ReadHandler
105
- closedSig chan struct {}
105
+ done chan struct {}
106
106
connState ConnState
107
107
closeDeadline time.Duration
108
108
}
109
109
110
110
func NewConnection (conn ext.Conn , opts ConnectionOptions ) (Connection , error ) {
111
111
wsc := & connection {
112
112
Conn : conn ,
113
- closedSig : make (chan struct {}),
113
+ done : make (chan struct {}),
114
114
connState : ConnStateOpen ,
115
115
logger : opts .Logger ,
116
116
}
@@ -239,7 +239,7 @@ func (wsc *connection) CloseWithMsg(closeCode int, msg string) error {
239
239
case <- time .After (wsc .closeDeadline ):
240
240
// sent a close, but never heard back, close anyway
241
241
err = errors .New ("close deadline expired" )
242
- case <- wsc .closedSig :
242
+ case <- wsc .done :
243
243
}
244
244
}
245
245
}
@@ -285,7 +285,7 @@ func (wsc *connection) runReadLoop(nextMsg chan connMsg) {
285
285
286
286
close (nextMsg )
287
287
wsc .unsetConnState (ConnStateListening )
288
- wsc .closedSig <- struct {}{}
288
+ close ( wsc .done )
289
289
}()
290
290
291
291
msg := connMsg {}
You can’t perform that action at this time.
0 commit comments