c# - .net core docker centos HttpRequest错误: (Socket Exception) Resource temporarily unavailable

标签 c# linux docker asp.net-core centos

我花了很多时间尝试了所有可以在 Google 上找到但无法成功的方法。

  • 我有一个带有 .Net Core 应用程序 3.1 Blazer 的工作 docker 容器。
  • 我将它托管在 Linux 服务器 centOS 8 上。它看起来像一个没有 Kubernetes 等的清晰 docker 容器...
  • 我可以打开我的网站并使用它

  • 但我无法从我的应用程序发送请求,如下所示:
    var response = await (await httpClient.GetAsync($"requestString}")).Content.ReadAsStringAsync();  
    

    在这部分代码我有错误:

    Unhandled exception rendering component: Resource temporarily unavailable System.Net.Http.HttpRequestException: Resource temporarily unavailable ---> System.Net.Sockets.SocketException (11): Resource temporarily unavailable at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) --- End of inner exception stack trace ---

    最佳答案

    关闭firewalld,然后重新启动docker。

    sudo systemctl stop firewalld
    sudo systemctl disable firewalld
    

    关于c# - .net core docker centos HttpRequest错误: (Socket Exception) Resource temporarily unavailable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62459831/

    相关文章:

    docker - 来自守护程序 : manifest for ibmblockchain/fabric-peer:latest not found 的错误响应

    c# - 可移植 C# IDE/编译器?

    c# - Crystal Reports 运行时许可如何运作?

    C# 遵守从​​ SQL 服务器中提取的字符串中的换行符

    c# - Unicode 到 ASCII 的转换/映射

    c++ - 如何将权限级别从 Linux 上的 C++ 程序提升到 root

    linux - Linux 何时调用 PCI 驱动程序的探测函数?

    docker - 使用 docker golang 库的卷装载选项 'z'

    linux - andlinux slirp 网络失败

    git - NPM 安装在 dockerized env 中失败