Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 1559

HttpClient convert code please

$
0
0

 Hi

We are using VC 2.3 for VS 2015.  We have a Windows Forms application that uses HttpClient, etc, to send and receive SOAP messages.

But I read from Microsoft:

"HttpClient is intended to be instantiated once and re-used throughout the life of an application. Instantiating an HttpClient class for every request will exhaust the number of sockets available under heavy loads. This will result in SocketException errors. Below is an example using HttpClient correctly."

C#
publicclassGoodController : ApiController
{
    // OKprivatestaticreadonly HttpClient HttpClient;

    staticGoodController()
    {
        HttpClient = new HttpClient();
    }
}

So can somebody convert the above code to Visual Cobol please?  The application consists of a main Form that calls other Forms and classes, all in separate projects.  Should we just instantiate the class at the main Form and reference it in the necessary projects?

Thank you

Brendan


Viewing all articles
Browse latest Browse all 1559

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>