yuhangch
2.53D
V2EX  ›  .NET

ASP.NET core 切换代理无法联网需要处理吗

  •  
  •   yuhangch · May 7, 2022 · 2309 views
    This topic created in 1484 days ago, the information mentioned may be changed or developed.

    .net core,EF core, npgsql

    在本机调试,切换代理后

    An exception occurred while iterating over the results of a query for context type '*.Context'.
          System.Net.Sockets.SocketException (22): Invalid argument
    

    其实就是连不上网络了,是使用了 BackgroundService ,连不上网络程序挂逼了才发现的

    按理说生产环境应该不存在切换网络的问题,所以这种情况需要处理吗?

    1 replies    2022-05-07 17:27:49 +08:00
    opengps
        1
    opengps  
       May 7, 2022
    当然需要处理,但不是针对代理做的。而是针对所有的网络不稳定做个断线自动重连功能
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2590 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 15:34 · PVG 23:34 · LAX 08:34 · JFK 11:34
    ♥ Do have faith in what you're doing.