Socket OK only for 10 minutes

I have a client/server application in which the client sends to server a String every second. The program works well, but exactly 10 minutes past from the time client connected the server throws "java.net.SocketException: Connection reset" and stops to receive the Strings, but the client continues working normally sending the Strings and the method socket.isConnected() at client continues returning true. This problem doesnt occur when I run the programs in localhost.
I tried do socket.setSoTimeOut(0), but the problem keeps. Somebody knows how to help me?

felipekennedy wrote:
I have a client/server application in which the client sends to server a String every second. The program works well, but exactly 10 minutes past from the time client connected the server throws "java.net.SocketException: Connection reset" and stops to receive the Strings, but the client continues working normally sending the Strings and the method socket.isConnected() at client continues returning true. This problem doesnt occur when I run the programs in localhost.
I tried do socket.setSoTimeOut(0), but the problem keeps. Somebody knows how to help me?socket.isConnected() does not tell you if the socket is connected, it simply returns true until you literally tell the socket to close. If the connection breaks somehow, socket.isConnected will continue to return true because it only tells you what you have done to the socket.
Any attempt to write to a socket after the connection has closed on the other end (or anything that breaks the connection) should result in an IOException being thrown by the write command. When your write command throws an IOException, it means your connection is jacked...and thus your client does not "continues working normally".
According to the API, socket.setSoTimeOut deals with the length of time the socket will block when you make a "read() call on the InputStream associated with this Socket", so I don't see how that would affect anything if you're just writing to the socket.

Similar Messages

  • So after updating my ipod touch 3rd gen to 4.3.1 i noticed a lag everytime i turn it back on. it stays on the lock screen for minutes sometimes hours. the screen is usually unresponsive the only things usually changing are the time and battery percentage.

    so aafter upsating my touch to 4.3.1 i have noticed everytime i restart the ipod there is a huge lag at the lock screen. the screen only updates itself every three to five minutes only updating the time and battery status. i cannot do anything, usually it will stay like this for minutes sometimes hours. i have tried restoring it and thought updating will fix the problem but it hasn't yet. i currently have ios 4.3.3. recently i had a friend look into the ipod and he told me on a folder called damaged files he found this, 37c3ad com.apple.autowake.plist. how can i fix this?

    Try a manual install following directions in link below.
    Basic troubleshooting steps. 
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD  120G Vertex 3 SSD Boot HD  

  • My iPhone 4s cannot join a public unsecured network but my iPad and macbook can.  I have reset the network settings twice.  Both times it worked, but only for a few minutes.  What can I do?

    My iphone 4s cannot join a public unsecured network, but my ipad and macbook can with no problems.  I have reset the network settings on the iphone twice.  Both times that fixed the problem but only for a few minutes, then I get the "cannot join network" message again.  Please help!  What can I do?

    Anyone have any ideas or information to help with this?  Any help and consideration is MUCH appreciated.

  • Proxy-Not able to read from socket for browser IE only for authorized sites

    Hi,
    I have implemented proxy server using socket connection. For Mozila it works properly, but not for IE.
    First it asks for proxy authentication, after providing the username and password for proxy in mozila its asks authentication for the authorized sites and its working properly. But in IE it just ask for proxy authorization and gives error as "you are not authorised to view this page" internally when I went through the code only first time its able to read the request and gives the response, but for the authorized site it wont ask for the username and password. After some time it throws the "Socket connection: reset" exception.
    Creates the connection:-
                   while(running){
                        try{
                             clientSocket = serverSocket.accept();
                                    }catch(SocketException se){
                                            se.printStackTrace();
                                   try{     
                             new HttpClientConnectionHandler(sockCon);
                        } catch(IOException se) {
                                             se.printStackTrace();
                                   }Sends requests and gets the response:-
    boolean continueSession = true;
              try{
                SCConnectionManager.increementConnCount();
              while (continueSession){
                        continueSession=false;
                    HttpHeader request = rqHandler.getRequest();
                        String con = request.getHeaderValue ("Connection");
                   boolean clientPersistentConnection = false;
                        String pcon = request.getHeaderValue ("Proxy-Connection");
                        System.out.println("request = "+request.toString());
                        if( ( request.getHTTPVersion().equalsIgnoreCase("HTTP/1.1")
                                            && !( pcon.equalsIgnoreCase("close") ) )
                                  || ( request.getHTTPVersion().equalsIgnoreCase("HTTP/1.0")
                                    && ( pcon.equalsIgnoreCase("Keep-Alive") ) ) ){
                                  //tempComment     debug("CLIENT Keeping connection true !!!!!! ");
                             clientPersistentConnection = true;
                    resHandler.Handle(request);     // Returns boolean ...can check its value...
                             if ( clientPersistentConnection == true && resHandler.connectionPersistent == true ) {
                                       //tempComment    
                                  debug("SERVER Keeping connection true !!!!!! ");
                                  continueSession=true;
                                  if ( resHandler.surfAsServer == true ) {
                                       client.setTimeout( persistentConnectionClientReadTimeout );
                             debug("CONTINUING CLIENT CONNECTION "+continueSession);
                   System.out.println("out of while loop continue sess = "+continueSession);
              }catch(IOException ioe){
                   log(ioe);     
                   if(qlc.qsm.log.Logger.debugOut) {
                        ioe.printStackTrace();
              } finally {
                   synchronized( this ) {
                        int connCount = SCConnectionManager.decreementConnCount();
                    SCConnectionManager.updateLastRequestTime();
                   close();
         }It does not come out of above while loop.

    Sorry, while copy the code one line was missing.
    code is:-
    while(running){
                        try{
                             clientSocket = serverSocket.accept();
                              } catch (SocketException se) {
                              se.printStackTrace();
                             continue;
                        }catch(IOException se){
                                       continue;
                        try{
                                       SocketConnection sockCon=new SocketConnection(clientSocket);
                                        new HttpClientConnectionHandler(sockCon);
                                   } catch(IOException se) {                         
                             se.printStackTrace();
                                             if ( clientSocket != null ) {
                                  try {
                                       clientSocket.close();
                                  } catch ( Exception exc ){
                                       clientSocket = null;
                                  decrementHttpCount();
                                  }

  • Email sync beetween imac an iPhone only for a few minutes

    email sync in icloud beetween imac an iPhone only for a few minutes, please help.

    Open System Preferences on your iMac then select iCloud.
    Deselect the box next to Mail & Notes then reselect the box then restart the iMac.
    Now tap Settings > iCloud on your iPhone
    Switch Mail off then back on the reset the device.
    Hold the On/Off Sleep/Wake button and the Home button down at the same time for at least ten seconds, until the Apple logo appears.

  • Recently bought new PC and authorized it for downloads but all songs are only 1 minute and 30 seconds?  Is there another button to hit???

    recently purchased a new HP PC and authorized for ITunes downloads but all my songs are coming in with only one minute and 30 seconds of recording...any suggestions?

    I don't have database access on weekends (look at it as a template)
    suppose you
    create table help_iot
    (bucket number,
    id1    varchar2(20),
    constraint help_iot_pk primary key (bucket,id1)
    organization index;not very sure about the create table syntax above.
    declare
      maximal_bucket number := 10000; -- will update few hundred rows at a time if you must update few million rows
      the_sysdate date := sysdate;
    begin
      truncate table help_iot;
      insert into help_iot
      select ntile(maximal_bucket) over (order by id1) bucket,id1
        from test_tab
       where id2 = '336015000385349';
      for i in 1 .. maximal_bucket
      loop
        select id1,id2,last_modified
          from test_tab
         where id2 = '336015000385349'
           and id1 in (select id1
                         from help_iot
                        where bucket = i
           for update of last_modified;
        update test_tab
           set last_modified = the_sysdate
         where id2 = '336015000385349'
           and id1 in (select id1
                         from help_iot
                        where bucket = i
        commit;
        dbms_lock.sleep(15);
      end loop;
    end;Regards
    Etbin
    introduced the_sysdate if last_modified must be the same for all updated rows
    Edited by: Etbin on 29.11.2009 16:48

  • TS2972 i have done all 7 steps recommended by the troubleshooting articles and only when i restart my router does my library show on apple tv2 but only for about 5 minutes, this was never a problem before the updates of itunes and apple tv2,

    i have done all 7 steps recommended by the troubleshooting articles and only when i restart my router does my library show on apple tv2 but only for about 5 minutes, this was never a problem before the updates of itunes and apple tv2, i have spent insane amounts of money on the apple store buying movies and tv shows that i cannot watch anymore, and no there is no firewall on my laptop nor my router, so no port configuration is needed
    i have read many articles for this problem but there is no solution, some say restart the router, others say uncheck the option to sync iphone over wi-fi, others suggest not hitting the "done" button after setting up homeshare on itunes, NONE of them work. My itunes library disappears from ym apple tv 2 after 5 minutes or so

    Did not work. I've selected iMessage to ON and left it. After a few hours I recieved a message "activation unsuccessful. Turn on iMessage to try again". This has been going on for the past 3 days.

  • My Mac air keeps on loosing wifi and when I want to switch it on! It says wifi hardware not installed.  After about 5 minutes the wifi is back on, but only for about 10 minutes before loosing signal again.

    My Mac air keeps on loosing wifi and when I want to switch it on it says "wifi hardware not installed"  After about 5 minutes the wifi is back on, but only for about 10 minutes before loosing signal again.  This is really frustrating.

    I am also having the same problem.. Its too much annoying and its unfortunate nobody at apple support has anyclue of what is happening?
    ... This is happening almost most of the time keeping my phone down most of the times.

  • My ipod touch 4th generation isnt charging with my cable. When i use my dad´s cable, it charges. But, however, after it´s fully charged (which takes strangely only a minute), i use it for five seconds and then it goes off. What should i do?

    My ipod touch 4th generation isnt charging with my cable.
    When i use my dad´s cable, it charges.
    But, however, after it´s fully charged (which takes strangely only a minute), i use it for five seconds and then it goes off.
    What should i do?

    - See:      
    iPod touch: Hardware troubleshooting
    - Try another cable if available
    - Try another charging source
    - Inspect the dock connector on the iPod for bent or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.
    - Make an appointment at the Genius Bar of an Apple store.
      Apple Retail Store - Genius Bar                 

  • Help with flex4unit ant build.xml: Socket timeout waiting for flexunit report

    I'm having trouble setting up ant to build and test my project locally and I'm not sure what the next step is.
    Info:
    Running on XP/Cygwin.
    All of the files that FlexUnit4 references when used in Flash Builder are in my '${basename}/libs' folder (eg FlexUnit4_1.0.swc).
    I've placed the flexunit4 task in my ant/libs folder.
    I'm getting two errors...
    I don't think I've set up the 'socket' stuff right for the tests. It just sits and waits then dies...
    [flexunit] Waiting for client connection ...
    (about a minute later)
    [flexunit] Stopping server ...
    [flexunit] End of test data reached, sending acknowledgement to player ...
    [flexunit] Closing client connection ...
    [flexunit] Closing server on port [1024] ...
    BUILD FAILED
    java.util.concurrent.ExecutionException: Socket timeout waiting for flexunit report
    Plus this is the error I get from the flash player:
    ReferenceError: Error #1065: Variable mx.skins.spark::BorderSkin is not defined.
    I don't know why it's complaining about Borderskin as I think I have included all the flex4 libs I could find. I suspect this second error is causing the first error?
    Any help appreciated. I think I'm just setting it up all wrong.
    Screencap of errors:
    http://twitpic.com/l7ay8
    build.xml:
    http://gist.github.com/20804

    Finally got everything working using the files from the CI Example which what i probably should have done in the first place.
    So a rough guide for anyone just starting out with this:
    Download the Flex 4 'workspace' from the digital primates hudson server . This appears to contain flexunit library and examples in various stages of development.
    I used Flex Builder 4 Beta 2 to set up my Test Suite and Test Cases.
    I then loaded the libs folder from:
    workspace.zip\workspace\project\FlexUnit4SampleCIProject
    into my flex project's libs folder:
    this includes:
    FlexUnit4.swc
    FlexUnit4CIListener.swc
    flexUnit4UIRunner.swc
    flexTasks.jar
    flexUnitTasks.jar
    I didn't need to remove the FlexUnit4 stuff that is 'referenced' automatically by flash builder when you start adding flexunit4 tests/suites.
    Then I used a modified version of the TestRunner.mxml found in:
    workspace.zip\workspace\project\FlexUnit4SampleCIProject\src\test\flex
    The lines to pay attention to are the ones that look like:
    static public function currentRunTestSuite():Array {
        var testsToRun:Array = new Array();
        testsToRun.push(packagename.TestSuiteName);
        testsToRun.push(packagename.TestClassName);
        return testsToRun;
    Just make sure you update this list to include all of the test suites &/or individual tests you want to run.
    I made this a static function and modified the code in the "FlexUnitApplication.mxml" file to use this function so i'd only need to update one list of suites/tests.
    FlexUnitApplication.mxml is generated automatically when you run FlexUnit4 tests in the Flash Builder 4 Beta 2 IDE.
    This is the build.xml file I'm using in the project:
    http://gist.github.com/208211
    Change the name of the project from "Flare" to whatever and adjust the other path settings where required (though you might want to write this from scratch at least once so you understand roughly what is going on).
    The Debug Flash Player must be installed on the server otherwise you'll get a:
    java.util.concurrent.ExecutionException: Socket timeout waiting for flexunit report
    ...while it waits for the non-existant debugger to attach. (This is obvious but I did forget and was a bit bewildered for a moment)
    Need to also ensure the environment variable:FLEX_HOME is set to the location you installed the flex sdk...by editing your .bashrc setting the environment variable the in the Hudson Configuration.
    You'll need to point Hudson at your ant installation and your jdk installation. If you downloaded he sdk, be aware you might need to point it to the jdk folder inside the place you installed the sdk.
    And I think that's all the problems I had. Hope it's useful to someone... if anyone who actually knows what they are doing can point out any potential issues/better ways of doing things, feel free to comment.
    Thanks to Brian (legrosb) and Mike (mlabriola) for their assistance!

  • Galaxy Note II Unresponsive for minutes at a time

    I'm on my 3rd galaxy note 2.  My first one had an overheating problem that caused the battery to last for 2 hours even though it was idle.  They ended up replacing it for me.  My 2nd one was actually perfect.  I had zero problems with it for nearly a year until the day after the 4.3 update, the screen went off and never came back on.  I just got my replacement about a week ago and I'm having an issue with the screen becoming unresponsive for minutes at a time.
    I factory reset the phone yesterday thinking that maybe I had a rogue app installed but it seems that any time I try to launch a game or if I try to browse the internet while an app is updating, the phone is unusable for a few minutes.  It's like it can't multitask. Eventually it'll come back with the phone at my home screen with my background image gone, but eventually it comes back too. It's similar to when windows explorer crashes and it reloads. I'll go through the same process for 2 or 3 more times before the game finally launches or the internet browser is finally usable.
    Before I call this phone defective, I was wondering if it's a problem related to 4.3 that I should be aware of?  I installed a monitor and it looks like with no apps open, from a fresh reboot my ram is 50-80% used which doesn't leave much room for opening apps or playing games.  I even installed a virus protection and scanned for a virus (i know viruses on smartphones is a stretch) and it returned no issues.
    Any ideas?  I could factory reset it again, but I just did that last night and it didn't help still having the same problem with very minimal apps reinstalled.  One note, I factory reset it with the restore from backup functionality turned off, so the apps I did install were from scratch, not my google account.

    I decided to call in.  I tell the rep my problems and he tells me to launch the phone in safe mode. Done. I could reproduce the issue. It then says wifi unstable.  The phone freezes with wifi on. Tells me to turn the wifi off. No more freezing while in safe mode, I guess wifi is the problem didn't think that was an issue before. He tells me that wifi issues have been reported but none of those issues cause the phone to freeze, he said that samsung told them to tell customers to turn that feature (ie: wifi) off until the next software update. He said samsung is working on a fix for the wifi issues but said there's no eta. I asked him for his gut feel and he said phones that are newer than 18 months normally get priority, given that the note 2 was release in november of 2012 and we're in 2014, that he estimated 3-4 months for the next update. I know I can't hold him to that but even if he's right, I have to leave wifi off for 3-4 months?...Now to the best part, "Since there is no freezing with wifi off in safe mode, and in safe mode the phone behaves in the state samsung designed it to be in, I've determined that it's not a hardware or operating system issue, so there's nothing I can do for you. I'm sorry I couldn't send you a new phone or resolve this problem for you, I hope you find a solution for the software issue you're having, good night."
    Rather than get mad I realized I wouldn't get anywhere with him so I didn't try to push the issue. I know I have unlimited data so it's not that big of deal, but wouldn't you consider the phone not working regularly with wifi turned on a hardware or os system problem?  It's not like I can uninstall and reinstall wifi.  The drivers are embedded in the system and since it's a refurb phone, who's to say that the parts that were refurbed are really factory oem?
    Now I'm stuck with a phone that is unusable randomly for 3-5 minutes using the phone normally with the mobile network/wifi because the agent didn't consider the problem to be hardware or os related and the only way to keep it from having issues is to not turn on wifi and keep the phone in factory default settings.
    I'm not going to threaten to leave or go somewhere else because it would serve no purpose, maybe that's why there was no attempt made to help me other than saying no from the beginning of the conversation, but in my 15 years of being a loyal customer, you would think "i hope you find a solution on your own" would be after sending me a new device if the problem persisted. 

  • Connection drops for minutes at a time

    Hi there.
    As I said in the title, the connection to the internet drops for minutes at a time although I am still connected to Airport Extreme. It has and can be down for pu to 20 minutes, with the only way of solving it that I see to be renewing the DHCP licence. Even when I do this, it can take up to 5 minutes to start working again.
    When the error is happening, in the assist pane of the Network settings, all the little lights are green up to ISP. Internet and below are orange.
    Any ideas?

    Any?

  • Photoshop CS6 - Quick Selection tool freezes Photoshop/ becomes unresponsive for minutes

    After only two selections the tool becomes unresponsive for minutes.
    I'm on a 2.6 Ghz retina MacBook Pro, 16 Gb RAM, and this in connection with an SSD should make this tool very good to use. Operating system: OS X 10.8 "Mountain Lion", latest update.
    Unfortunately, it seems to develop some kind of overload, during which you cannot use Photoshop at all. No commands like "undo selection", "quit", "close file" are accepted.
    There is no beachball, no other signs that Photoshop is working on something.
    Hint: it seems to happen when you option select (subtract from an existing selection).
    Hint: the freeze can be shortened by a tool switch (has to be through clicking on a tool, keyboard commands are frozen as well)
    Hint: the "subtract selection" move that caused the freeze appears after Photoshop comes back to life after a couple of minutes. The subtraction to the selection seems to be random, makes no sense, and is not the regular function of the tool.
    First step after this freeze would be to undo the last selection, and continue working.
    If you do several "add to selection" moves, they add up in a kind of waiting line. If you do the subtract from selection move, this doesn't work, and the freeze happens.
    So far, I have not noticed the freeze when adding to a selection. Adding to a selection was always quick and instant. The bug must sit in the "subtract from selection" code.
    On most freezes, the ants continue walking, I just had one (again with subtracting selection) where even the ants stopped walking.
    I don't think it has anything to do with Photoshop working. I have used the quick selection tool regularly under CS5 on my old machine (which was a museum piece), and while I had to wait sometimes, it was never ground to a freeze/halt like the quick selection tool under CS6.

    Did this work before, or has it always been this way?  Not a bug or everyone with your system would be complaining.  Have not seen that.
    If it has always worked that way a reset of preferences will probably not do anything.
    A reset of preferences will reset to factory defaults, so you will have to reset to saved workspace.
    Do you have at least 10% free disk space? 

  • Downloaded a cd and the songs are only 1 minute 30 seconds long. what do I do?

    I downloaded an entire cd of 15 songs and when I went to listen to them, each song was only a minute and 30 seconds long. They were just like the samples. I paid $9.99 for the cd and the amount was immediately deducted from my account. What do I have to do to get the full versions of the songs without being charged again for them??

    Does the track play correctly in Quicktime Player?  If it does then it is an iTunes issue.  If it doesn't then it is possible the file was not completely downloaded, or is corrupt.  If you are in a country where re-downloading is possible (iTunes in the Cloud and iTunes Match Availability by Country - http://support.apple.com/kb/HT5085), delete the track and download again (Downloading [using iOS or computer] past purchases from the App Store, iBookstore, and iTunes Store - http://support.apple.com/kb/ht2519).  See tips on downloading in https://discussions.apple.com/message/19097773
    Other possible considerations:-
    Is your iTunes up to date?
    https://discussions.apple.com/thread/3712298 - applying system update cleared issue of songs ending early
    Solution to purchased songs not playing (2009) - http://discussions.apple.com/thread.jspa?threadID=1934256 - authorization issues and files not playing all the way through
    https://discussions.apple.com/message/17382022 - Problem was incomplete files due to poor WiFi connection
    https://discussions.apple.com/message/17661693 - issue resolved by re-downloading files or rebuilding library file [note, although the poster says this restored all, my understanding is the .xml file does not retain all the details of the original library file].
    https://discussions.apple.com/thread/3988957 - updating Match
    This and similar incomplete playback seems to be reported several times a day here.  I don't recall this happening before iTunes 10. I would suggest posting feedback to Apple so they aware of an issue.
    iTunes application feedback - http://www.apple.com/feedback/itunesapp.html

  • Meet The Expert Session 2 with Pat Smith Only 5 minutes left!

    Okay...only 5 minutes left for the Meet The Expert Session with Pat Smith.
    Please post your question or comment now!

    Need more time. 1 hour goes by so fast. But thank you for making this possible. I should have made a list like for Santa.

Maybe you are looking for