开发者

Android Woes....Why no socket exception? Work around?

I have a socket connection thread using objectinput and output stream to read and write objects across the socket.

In Android 2.1 update and 2.2.开发者_开发技巧1, whenever you call a socket.shutdownOutput(), it throws an exception in the connection thread, I catch it and do a finally for a a cleanup. For some funny reason socket.close() does not throw an exception in the versions mentioned either.

In 2.2.2, this is not the case. Calling shutdownOutput(), shutdownInput(), close() all do not throw any exceptions at all, and I have to wait until the socket timeout is called before I can do any cleanups.

Can anyone shed some light on what is happening? A workaround solution would be nice too.

Thanks!


Ok I dug up some posts from last time regarding the issue, but the workaround does not work for 2.2.2. code.google.com/p/android/issues/detail?id=6144 and code.google.com/p/android/issues/detail?id=7933

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜