yuhangch
2.53D
V2EX  ›  .NET

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

  •  
  •   yuhangch · May 7, 2022 · 2784 views
    This topic created in 1646 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
    opengps
    May 7, 2022
    1
    当然需要处理,但不是针对代理做的。而是针对所有的网络不稳定做个断线自动重连功能
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4504 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 02:28 · PVG 10:28 · LAX 18:28 · JFK 21:28
    ♥ Do have faith in what you're doing.