diff --git a/testing/scenarios/vmess_test.go b/testing/scenarios/vmess_test.go index 4dd1f54fb..7cff75145 100644 --- a/testing/scenarios/vmess_test.go +++ b/testing/scenarios/vmess_test.go @@ -1209,7 +1209,7 @@ func TestVMessGCMMuxUDP(t *testing.T) { xorpayload := xor(payload) - for j := 0; j < 5; j++ { + for j := 0; j < 2; j++ { nBytes, _, err := conn.WriteMsgUDP(payload, nil, nil) assert.Error(err).IsNil() assert.Int(nBytes).Equals(len(payload)) @@ -1217,7 +1217,7 @@ func TestVMessGCMMuxUDP(t *testing.T) { response := make([]byte, 1024) oob := make([]byte, 16) - for j := 0; j < 5; j++ { + for j := 0; j < 2; j++ { nBytes, _, _, _, err := conn.ReadMsgUDP(response, oob) assert.Error(err).IsNil() assert.Int(nBytes).Equals(1024) diff --git a/testing/servers/udp/udp.go b/testing/servers/udp/udp.go index ed8561160..a0f916723 100644 --- a/testing/servers/udp/udp.go +++ b/testing/servers/udp/udp.go @@ -41,7 +41,9 @@ func (server *Server) handleConnection(conn *net.UDPConn) { } response := server.MsgProcessor(buffer[:nBytes]) - conn.WriteToUDP(response, addr) + if _, err := conn.WriteToUDP(response, addr); err != nil { + fmt.Println("Failed to write to UDP: ", err.Error()) + } } }