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

close conn after use

This commit is contained in:
Darien Raymond 2018-11-11 21:13:05 +01:00
parent 956868ef78
commit 891bdd14fe
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -131,6 +131,7 @@ func TestCommanderRemoveHandler(t *testing.T) {
cmdConn, err := grpc.Dial(fmt.Sprintf("127.0.0.1:%d", cmdPort), grpc.WithInsecure(), grpc.WithBlock())
assert(err, IsNil)
defer cmdConn.Close()
hsClient := command.NewHandlerServiceClient(cmdConn)
resp, err := hsClient.RemoveInbound(context.Background(), &command.RemoveInboundRequest{
@ -311,6 +312,7 @@ func TestCommanderAddRemoveUser(t *testing.T) {
cmdConn, err := grpc.Dial(fmt.Sprintf("127.0.0.1:%d", cmdPort), grpc.WithInsecure(), grpc.WithBlock())
assert(err, IsNil)
defer cmdConn.Close()
hsClient := command.NewHandlerServiceClient(cmdConn)
resp, err := hsClient.AlterInbound(context.Background(), &command.AlterInboundRequest{
@ -524,6 +526,7 @@ func TestCommanderStats(t *testing.T) {
cmdConn, err := grpc.Dial(fmt.Sprintf("127.0.0.1:%d", cmdPort), grpc.WithInsecure(), grpc.WithBlock())
assert(err, IsNil)
defer cmdConn.Close()
const name = "user>>>test>>>traffic>>>uplink"
sClient := statscmd.NewStatsServiceClient(cmdConn)