问个HttpClient 的问题# Java - 爪哇娇娃
s*d
1 楼
第一次用http protocol, 不太熟,想问一下,我写的是client side, 如果我需要两个
thread, thread1 is just doing regular basis GET request and read the
response in a while loop. Thread2 needs to send GET request once and keep
the connection open and read the response stream continuously.(别问为什么,
不是我design的) Do I need two HttpClient instances? Because I'm afraid if I
only create one HttpClient, it will reuse the connection, then thread1 will
be blocked by thread2 since it never ends reading the data. If I create two
HttpClient
thread, thread1 is just doing regular basis GET request and read the
response in a while loop. Thread2 needs to send GET request once and keep
the connection open and read the response stream continuously.(别问为什么,
不是我design的) Do I need two HttpClient instances? Because I'm afraid if I
only create one HttpClient, it will reuse the connection, then thread1 will
be blocked by thread2 since it never ends reading the data. If I create two
HttpClient