mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-09-25 19:54:04 -04:00
unified task package
This commit is contained in:
@@ -9,9 +9,9 @@ import (
|
||||
"v2ray.com/core"
|
||||
"v2ray.com/core/common"
|
||||
"v2ray.com/core/common/buf"
|
||||
"v2ray.com/core/common/functions"
|
||||
"v2ray.com/core/common/net"
|
||||
"v2ray.com/core/common/signal"
|
||||
"v2ray.com/core/common/task"
|
||||
"v2ray.com/core/proxy"
|
||||
"v2ray.com/core/transport/internet"
|
||||
"v2ray.com/core/transport/internet/udp"
|
||||
@@ -118,7 +118,10 @@ func (d *DokodemoDoor) Process(ctx context.Context, network net.Network, conn in
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := signal.ExecuteParallel(ctx, functions.OnSuccess(requestDone, functions.Close(link.Writer)), responseDone); err != nil {
|
||||
if err := task.Run(task.WithContext(ctx),
|
||||
task.Parallel(
|
||||
task.Single(requestDone, task.OnSuccess(task.Close(link.Writer))),
|
||||
responseDone))(); err != nil {
|
||||
pipe.CloseError(link.Reader)
|
||||
pipe.CloseError(link.Writer)
|
||||
return newError("connection ends").Base(err)
|
||||
|
Reference in New Issue
Block a user