Before bind to the same port & listen/connect, you may set the socket's reuse address to true before the binding. like: socket.setResuseAddress(true); At 2012-02-22 14:47:54,"Nitin Gaikwad" <[email protected]> wrote: >HI Gene, > >Thanks for reply > >As i read the post and blog i think after the restart the service on >the memory low warning service not goes in the destroy function.But >still also i added the Destroy(); function where i close all the >socket . But still i am not able to retain the Socket. > >Also one point about my service is it have broadcast receiver where i >have write the code for the onboot so is there any option to add the >low memory restart service option > >Thanks > NItin Gaikwad > >On Feb 21, 5:30 am, Gene <[email protected]> wrote: >> I am not an expert on this, but am pretty sure you will have to >> implement onDestroy() and do an orderly close on the sockets you are >> using. >> >> On Feb 18, 2:30 am, Nitin Gaikwad <[email protected]> wrote: >> >> >> >> > Hi Friends, >> > 1 I am developing one application where i write one service using >> > broadcast receiver. >> > 2 In this service i use the socket programing where i communicate with >> > client. >> > 3 the application works like after the device boot the service will >> > start and listen the port to get the data. >> > 4 this will work normally but problem come when the service restart >> > means when there the memory low (multiple application open that time) >> > service will restart automatically. >> > 5 Here when service again goes to try to connect to socket this not >> > working >> >> > so is there any thing missing or should i need to do anything in code >> > please let me know. >> >> > thanks >> > Nitin Gaikwad > >-- >You received this message because you are subscribed to the Google >Groups "Android Developers" group. >To post to this group, send email to [email protected] >To unsubscribe from this group, send email to >[email protected] >For more options, visit this group at >http://groups.google.com/group/android-developers?hl=en
-- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

