Closed
Description
My issue is that when my web browser navigates to these url:
http://localhost:44382/api/Todo/3
http://localhost:44382/api/Todo
With command "netstat -nao | findstr 44382", It shows only one socket connection port opened during the whole time. The same even with more different HTTP Request.
While Use RestClient(Code below), It seems that every HTTP Request Creates a different socket connection port althought it will be released within a few minute.
for (int i = 1; i <= 10; i++)
{
var client = new RestClient("http://localhost:44382/api/Todo/3");
var request = new RestRequest();
equest.Method = Method.GET;
request.RequestFormat = DataFormat.Json;
var asyncHandle = client.GetAsync<TodoClass>(request, (resp, callback) =>
{
Console.WriteLine(resp.Content);
callback.Abort();
});
}
Is there a best way to avoid create different socket port by use one same socket?
look forward to get your reply !