2015-05-19 25 views

回答

0

來源:developer.android.com

公共無效setReadTimeout(INT timeoutMillis) 設置最長等待時間爲閱讀放棄之前完成的輸入流。如果在數據變爲可用之前超時已過,則讀取將失敗,併發生SocketTimeoutException。默認值爲禁用讀取超時;讀取嘗試將無限期地阻止

setReadTimeout(0) == block indefinitely (Or until read buffer is full) 

setReadTimeout(10) == return Exception, after 10 mili sec, if buffer isn't full 
相關問題