开发者

Android TCP socket and Streaming. No Errors or exceptions when sending data after conectivty loss

开发者 https://www.devze.com 2023-01-22 13:44 出处:网络
Im trying to determine if data was successfully sent to the server through a TCP socket using the OutputStream object. for testing purposes i disable network communications in the phone and OutputStre

Im trying to determine if data was successfully sent to the server through a TCP socket using the OutputStream object. for testing purposes i disable network communications in the phone and OutputStream.write(); doesn't throw an exception, all the methods in the socket class return as though the socket is active and working. Is there anything i'm doing wrong here?

is there any socket implementation or stream implementation i can use to get an exception or error when the stream / socket doesn't actually send the data in the buffer?

also setting SetSoTimeout() on the socket doesn't seem to do anything开发者_Go百科.

Thanks, Totem


If you're using the emulator this is a known bug, data can still be sent after enabling airplane mode.

0

精彩评论

暂无评论...
验证码 换一张
取 消