1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-10 01:40:44 +00:00

relace Notifier with Done

This commit is contained in:
Darien Raymond 2018-06-09 04:29:40 +02:00
parent 897b5a51f0
commit 70abb689bf
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -7,7 +7,6 @@ import (
"v2ray.com/core"
"v2ray.com/core/common"
"v2ray.com/core/common/net"
"v2ray.com/core/common/signal"
"v2ray.com/core/common/signal/done"
"v2ray.com/core/transport/pipe"
)
@ -80,8 +79,8 @@ func (co *Outbound) Dispatch(ctx context.Context, link *core.Link) {
return
}
closeSignal := signal.NewNotifier()
c := net.NewConnection(net.ConnectionInputMulti(link.Writer), net.ConnectionOutputMulti(link.Reader), net.ConnectionOnClose(signal.NotifyClose(closeSignal)))
closeSignal := done.New()
c := net.NewConnection(net.ConnectionInputMulti(link.Writer), net.ConnectionOutputMulti(link.Reader), net.ConnectionOnClose(closeSignal))
co.listener.add(c)
co.access.RUnlock()
<-closeSignal.Wait()