Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #9060
Closed
Open
Issue created Mar 24, 2021 by Administrator@rootContributor

[BUG][csharp-netcore] C# Client for Net Core generate port exaustion

Created by: lucamazzanti

Description

I moved from Net Framework 4.7 to Net Core 3.1 and 5 and I have a critical issue.

The csharp-netcore client uses RestSharp and is not stable with Net Core actually. See this issue. It seems to be a net core breaking change they won't patch in time and actually this is impacting on RestSharp.

It silently open at every call a new socket, creating a new HttpWebRequest each time. This is a behavior totally different in NetFramework where it keep the same. You can reproduce it easily generating a simple client and using it in both verisons. Test multiple calls and watch the connection in Wireshark, I can further add images or a report if you prefer.

While NetFramework honors the keep-alive header (supported also by the server) in Net Core it doesnt.

  • In NetFramework it do the handshake and TLS connection just 1 time, and it consumes just one socket keeping working on it with the next calls.
  • In Net Core not, it open a new socket each times.

This is critical because you cannot understand it when moving your client to net core until you have a feedback from the server closing the connections to all.

I see there is a version with HttpClient, i tried it but it create every time: var handler = new HttpClientHandler(); var client = new HttpClient();

openapi-generator version

openapi-generator-cli-5.1.0.jar with csharp-netcore client without settings.

Assignee
Assign to
Time tracking