0
從java.net.Socket#setSoTimeout
的Javadoc,它說:如何理解http放置的SocketTimeout?
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds. With this option set to a non-zero timeout, a read() call on the InputStream associated with this Socket will block for only this amount of time. If the timeout expires, a <B>java.net.SocketTimeoutException</B> is raised, though the Socket is still valid.
對於HTTP PUT操作,客戶可以上傳一個巨大的文件,客戶端總是寫,從來沒有從服務器讀取數據。
在這種情況下,如果我爲http客戶端設置了SocketTimeout,它會在上傳過程中拋出TimeoutException嗎?