You might try closing the socket and trying to connect it again, the
same way it was opened before the disconnect.

15 minutes is a relatively long time... does the socket live in an
activity? It should probably live in a service so its resources don't
get reclaimed like an activity would. Activities are subject to
certain rules that says if Android OS needs the resources, it can kill
or reclaim the activity's resources when it needs to.


On Dec 14, 9:06 am, Ron <ronbruck...@comcast.net> wrote:
> I am able to connect to a Socket on my PC from my HTC 1 phone, via IP
> and successfully transfer data in a thread that gets rescheduled every
> few seconds.  The problem is that after 15 minutes or so, the
> connection drops and my debug traces give me the "Network
> unreachable".  A further clue is that if I plug in or replug in the
> USB cable I get reconnected.
>
> I'm wondering what programmatic function will reconnect to the PC
> without having to fiddle with the USB cable.  I've tried
> Wifimanger.reconnect and reassociate, neither did the trick.  Perhaps
> if I knew what actions were peformmed when the usb cable is plugged in
> (which shouldn't have anything to do with my connection) I would be
> able to program them into my exception path.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to