HTTPS Requests and Multithreading

Is Java URLa thread safe class, in particular [ URL.openConnection()] ( http://java.sun.com/javase/6/docs/api/java/net/URL.html#openConnection ()) ?

In my application, I am making dozens of simultaneous HTTPS connections to the second with the same URL, and I would like to maximize the reuse of objects. However, it is not clear from the documentation what can be reused.

EDIT: I am open to using another library if necessary.

+3
source share
3 answers

HTTP java Apache HttpClient. HTTP 1.1, , HTTP-/ .

, .

+3

. -. .

Sun , . , ( ErrorStream). .

+3

URL.openConnection HttpsURLConnection, HttpURLConnection. docs HttpURLConnection , . , ala HTTP 1.1.

, HttpsURLConnection URL.openConnection, .

0

Source: https://habr.com/ru/post/1722741/


All Articles