Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
HttpURLConnection完了する前にタイムアウトが発生した場合にイベントを発生させる方法はありますか?
HttpURLConnection
このための組み込みのタイムアウトはありません。私がしていることは、別のスレッドを使用し、タイムアウト後にスレッドを中断することです。
これにはFutureTaskを使用する方が簡単です。この質問に対する私の答えを見てください、
javaネイティブプロセスタイムアウト
URLConnection.setConnectTimeout() URLConnection.setReadTimeout()
@1.5以降