You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li><ahref="#How_to_deal_with_cookies">How to deal with cookies</a></li>
76
76
<li><ahref="#How_to_use_with_AWS_Load_Balancing">How to use with AWS Load Balancing</a></li>
77
-
<li><ahref="#How_to_force_TLS_v1.2_and_above">How to force TLS v1.2 and above</a></li></ul>
77
+
<li><ahref="#How_to_force_TLS_v1.2_and_above">How to force TLS v1.2 and above</a></li>
78
+
<li><ahref="#How_to_create_a_lot_of_clients">How to create a lot of clients</a></li></ul>
78
79
<section>
79
80
<h2><aname="How_to_deal_with_cookies"></a>How to deal with cookies</h2>
80
81
<p>In order to store the cookies sent by the server and include them in all subsequent requests, you need to create an OkHttpClient with a custom <aclass="externalLink" href="https://square.github.io/okhttp/4.x/okhttp/okhttp3/-cookie-jar/">cookie jar</a>.</p>
@@ -210,7 +211,33 @@ <h2><a name="How_to_force_TLS_v1.2_and_above"></a>How to force TLS v1.2 and abov
<p>Note: we will upgrade to OkHttp 4 in the next major version.</p></section>
214
+
<p>Note: we will upgrade to OkHttp 4 in the next major version.</p></section><section>
215
+
<h2><aname="How_to_create_a_lot_of_clients"></a>How to create a lot of clients</h2>
216
+
<p>By default, you won’t be able to create more than 5 Socket.IO clients (any additional client will be disconnected with “transport error” or “ping timeout” reason). That is due to the default OkHttp <aclass="externalLink" href="https://square.github.io/okhttp/4.x/okhttp/okhttp3/-dispatcher/">dispatcher</a>, whose <code>maxRequestsPerHost</code> is set to 5 by default.</p>
217
+
<p>You can overwrite it by providing your own OkHttp client:</p>
<p>Note: we use <code>MAX_CLIENTS * 2</code> because a client in HTTP long-polling mode will have one long-running GET request for receiving data from the server, and will create a POST request for sending data to the server.</p></section>
0 commit comments