Strange problem socket programming on different Windows plattform

Want to connect to site in internet like http://www.google.com. In Eclipse and as .jar.File on my Windows 7 everything runs fine. On Windows 2003 or Vista I cut LAN, so no network and the application response 'ok' and do not throw an Exception, what my Windows 7 and another Windows XP do immediately. New start of application has the same effect. After a time of circa 20 seconds application throws an Exception. Bad surprise. All Windows use java version 1.6.0_21.
Any ideas, please.
     URL url=null;
               try{
                         url=new URL("http://www.google.de");
               }catch(MalformedURLException e){
                    System.err.println("01");
     try {
               URLConnection con=url.openConnection();
               con.setConnectTimeout(250);
     }catch(IOException e){
          System.err.println("03");
     InetAddress inetAddress=null;
     try{
               inetAddress=InetAddress.getByName(url.getHost());
     }catch(UnknownHostException e){
          System.err.println("04");
     SocketAddress socketAddress=new InetSocketAddress(inetAddress,80));      
     Socket clientSocket=new Socket();
     try{
          clientSocket.connect(socketAddress,250);
     }catch(SocketTimeoutException stoe){
          System.err.println("05");
     }catch(IOException ioe){
          System.err.println("06");
     if(clientSocket!=null){
               if(!clientSocket.isConnected()){
                    System.err.println("07");
               try{
                         clientSocket.close();
               }catch(IOException e){}
     }else{
          System.err.println("08");
     }                      

1. JVM would never get information network is broken.I didn't say anything even remotely resembling that, and I didn't say anything about the JVM at all.
2. Different hardwareI didn't say anything about hardware either.
So you haven't 'disproved' anything yet.
Win XP Pro SP3 on Pentium M and Celeron laptops get information from its hardware.Obviously, and from their TCP/IP stacks.
JVM get information from OSObviously.
and put it to cache every definied time as reply a cycle.I can't make much sense of that, but the JVM certainly doesn't maintain TCP reply timers. It relies entirely on the TCP/IP stack for that.
This unit of time should be set shorter. I think, I have to parameterization JVM to put the information for TCP/IP in shorter time to cache. I would know gladly where this has to define.As this imaginary timer doesn't exist, there is nothing to define. As I already told you, 'there is nothing you can do about it within Java'.
If the hardware delivers an interrupt to the operating system and the operating system delivers that in some form to the TCP/IP stack and the TCP/IP stack construes it as a cable loss and turns that into a ' connection reset', that's what you will get in your Java code. If all that doesn't happen, you won't.

Similar Messages

  • Strange problem with AIX server and windows clients

    I am having a real bizzare problem with WLS 7.0.1 running on AIX 5.1 and
    clients on windows. We have J2SE Swing application as a client.
    If the client is w2k or XP, the first client gets good response. If I start
    another client the second client is horribly slow (2 sec vs 16 sec). Even if
    I kill the first client the second client continues to be slow. If I have 2
    clients open together, the first one continues giving 2 sec response while
    the second one continues with 16 sec. For that matter if I start another
    client after shutting down first one I get slow (16 sec) response.
    If the client is NT client I always get good and consistent response from
    the server. Irrespective of how many client I have on the NT machine, I keep
    getting good response. NT and W2K laptops are seating right next to each
    other on the same n/w and infact the NT is a much slower and lessor memory
    machine than W2K.
    We did similar tests keeping server on Solaris or NT server or W2K server,
    and the clients "behave" normally i.e I get consistent repsponse time (it
    may be slow or fast, but it is consistent and is consistent b/w NT and W2K).
    We even tried putting my laptop on the same network as the AIX server, but
    it did not help. Unfortunately some of our clients will be using AIX and
    W2K.
    HELP!!!!

    "Cameron Purdy" <[email protected]> wrote in message
    news:[email protected]..
    Sounds like a reverse DNS lookup or similar network timeout.Thanks for the suggestion, but then why would the first client on w2k or XP
    get a better performance and the subsequent clients get worse performance?
    >
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    http://www.tangosol.com/coherence.jsp
    Tangosol Coherence: Clustered Replicated Cache for Weblogic
    "vinay moharil" <[email protected]> wrote in message
    news:[email protected]..
    I am having a real bizzare problem with WLS 7.0.1 running on AIX 5.1 and
    clients on windows. We have J2SE Swing application as a client.
    If the client is w2k or XP, the first client gets good response. If Istart
    another client the second client is horribly slow (2 sec vs 16 sec).
    Even
    if
    I kill the first client the second client continues to be slow. If I
    have
    2
    clients open together, the first one continues giving 2 sec response
    while
    the second one continues with 16 sec. For that matter if I start another
    client after shutting down first one I get slow (16 sec) response.
    If the client is NT client I always get good and consistent responsefrom
    the server. Irrespective of how many client I have on the NT machine, Ikeep
    getting good response. NT and W2K laptops are seating right next to each
    other on the same n/w and infact the NT is a much slower and lessor
    memory
    machine than W2K.
    We did similar tests keeping server on Solaris or NT server or W2Kserver,
    and the clients "behave" normally i.e I get consistent repsponse time(it
    may be slow or fast, but it is consistent and is consistent b/w NT andW2K).
    We even tried putting my laptop on the same network as the AIX server,
    but
    it did not help. Unfortunately some of our clients will be using AIX and
    W2K.
    HELP!!!!

  • Problem: Socket connection is not creating in machine, through utility program (MFC Dll), on ListDisplay service port - 3334 (on separate machine), while we are able to telnet on same ListDisplay service port - 3334 from same issue machine on same time

    Problem: Socket
    connection is not creating in machine, through utility program (MFC Dll), on ListDisplay service port - 3334 (on separate machine), while we are able to telnet on same ListDisplay service port - 3334 from same issue machine on same time
    Environment: -
    OS:
    Windows XP SP2/7
    Code:
    VC 6.0
    Dll: MFC
    Problem Description: -
    We have written a utility program which create socket (Using windows standard method [MFC]), and then make connection with another service (List Display) running
    on port 3334 in different machine and retrieve the required list data. This program was working fine in almost all the machines.
    But, we have received a severe intermittent issue on two machines. Client is facing issue in displaying the list data from port 3334.
    Attempt: -
    First we tried to debug code, and we come to know that socket is not creating in utility program. So we tried to telnet on ListDisplay service port 3334 and we were surprised that we were able to telnet, then we opened some more
    telnet window on same port 3334 around (6 to 8) window, and each cmd connected properly. But we were not able to create socket from utility program.
    Problem is severe because issue is intermittent.
    We have tried all the way, but we are not able to figure it out, that what can be the exact problem and what are the conditions, when utility program will not
    connect with ListDisplay service on port 3334.
    Kindly assist to resolve this issue. For any help, we would be really thankful.

    Hi,
    According to your description, it seems that you have created an utility program which is making connection with another service port 3334, however, two clients are facing issue in display the data list from port 3334.
    Port: 3334/TCP
    3334/TCP - Known port assignments (1 record found)
    Service
    Details
    Source
    directv-web
    Direct TV Webcasting
    IANA
    Since the port 3334 is used by directv-web service, I'd like to suggest check this service it is working well on the problematic clients.
    1. The client can be resolved in DNS well? Please run "nslookup" in the prompt command.
    2. Is there any 3rd party application interrupting? Do test in clean boot.
    2. Strongly suggest you run process monitor tool to analysis it.
    I am looking forward to your reply if you have any updated on your side.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Problem in opening excel file in different window

    hi
    i want to open excel file in different window it open in same window properly on the bases of condition but when i try to open in different with window.open( )
    it give error that file has already used or path not exist OR requisted site either unavailable
    how can i rectified

    Hi.
    I am too facing the same problem. I am using Jakarta Poi to display my resultset in an excel sheet directly(and not into a jsp)
    The browser opens a window showing Open Save Cancel. If i click and save the excel sheet and then open, it opens. But clicking on Open directly doesnt open the excel sheet. Rather it gives the same error
    The file name or path name does not exist.
    The file you are trying to open is being used by another progrtam . close the document in other program and try again
    The name of the work book your tring to save is the same as name of another document that is readonly .try saving workbook with different name
    Can somebody please help me fix this problem, since its an urgent requirement. Mail me at [email protected]
    Thanks
    Hitesh

  • Strange problem with 2 different Soundblaster car

    I have a very strange problem with these 2 cards First i had soundblaster li've value which was installed with the default windows drivers. Although it'swas installed correctly in device manager, i hear no sound and when i go to control panel->sounds and audio devices, under the volume tab there?was no audio device and everything?was greyed. But when i restart or shutdown the pc the windows sound suitable for this action played without problems. Media player couldn't play any sound, neither youtube. I downloaded and installed the Li'veDrvUni-Pack(ENG). Everything worked ok but after a while i had the same problem. So i decided to buy a different sound card, the Li've Audigy SE. Installed, worked fine, but after a short period of time i have the same problem. Most of the times when i boot into Windows the sound is ok, after a while (5 minutes or hour) i hear no sound and in the control panel i see the no audio device message although in control panel the card appears to be installed correctly. Any ideas?

    Yes, I agree.
    But my question: is there any software trick that I could use to fix the situation.
    For example, how can I ask 2 keyboards about each one's NumLock state ?
    I know about getLockingKeyState() function, but it always returns the NumState of the regular keyboard. How can I know and/or change the NumLock state of the small one ?
    Thanks

  • Desktop to socket programming conversion problem?

    i have a Online desktop application.
    i want to convert in Socket programming for Efficiency and Quick response.
    i successfully connect client to server and server to client its work well.
    now problem is that i had in application different type of objects , Database quires results, some Business class and other needed class.
    how i pass these thinks to server to client and vice versa and distinguish them?

    I am very THANK Full for your Efforts
    i locked my xml file succssfuly; but i still got same exception
    locking a file code
    Initializing streams
    try {
                is = new ObjectInputStream(clientSocket.getInputStream());
                os = new ObjectOutputStream(clientSocket.getOutputStream());
               fs = new FileOutputStream("first.xml");
                BufferedOutputStream br = new BufferedOutputStream(fs);
                xml = new XMLEncoder(br);
            } catch (IOException e) {
                System.out.println(e);
    Locking a file it display file is locked
         System.out.println("Trying to lock locked..");
          fl = fs.getChannel().tryLock();
          System.out.println("File locked..");
          xml.writeObject(ud);
          xml.flush();
          fl.release();
          System.out.println("lock released...");    
          fl.release();
          is.close();
          os.close();
          xml.close();
          clientSocket.close();       

  • Hi! I can't upgrade my iTunes 10.3.1.55 on my Windows XP 2002 SP3 to the latest version of iTunes. Got the message: "A problem has occured with the Windows Installer-package. A program needed for this installation could not be run." What to do?

    Hi! I can't upgrade my iTunes 10.3.1.55 on my Windows XP 2002 SP3 to the latest version of iTunes. Got the message: "A problem has occured with the Windows Installer-package. A program needed for this installation could not be run." What to do?

    Perhaps let's first try updating your Apple Software Update.
    Launch Apple Software Update ("Start > All Programs > Apple Software Update"). Does it launch and offer you a newer version of Apple Software Update? If so, choose to install just that update to Apple Software Update. (Deselect any other software offered at the same time.)
    If the ASU update goes through okay, try another iTunes install. Does it go through without the errors this time?

  • Strange problems with Windows 7 running on Bootcamp

    Hi there. I have just installed Windows 7 using Bootcamp on my Macbook with Leopard. I have a few strange problems and just wanted to see if I could gain any help or see if anyone else is experiencing these problems. Apart from those, its running great :P
    Main one is when I close the macbook shut, then open it back up the screen stays black, i can hear it open back up but its like it just stays in Sleep mode. I then need to hold down the power button and switch it back on.
    Secondly when I use the down, up left or right arrow button to scroll down in the respective direction the cursor is moving around like it would on a word document. It will scroll down eventually but only becuase the cursor has reached the end of the page.
    Thanks for your time and I really hope someone can shed some light.

    Hey, I'm having this issue too, however I also get freezes while the screen is still on, or while the screen power saves, and will not resume.
    The computer stays on, and warm, meaning it never powers off, nor realizes its hung-up, and the only way to get back to work is a hard shutdown and reboot.
    Details are below, and x64 Win 7 MSDNAA RTM Build 7600 - 4gb of Corsair 4-4-4-12 2x2 ram.
    I have already gotten the newest commercial nVidea drivers and I am running RivaTuner with appropriate settings, and I have disabled the Wired NIC, and turned off the wireless NIC power-saving settings.

  • Windows 7 gadgets are not working anymore. Strange problem.

    Hello
    I'm having a strange problem with windows 7 Gadgets, I describe it as follows:
    1. Drag and drop a gadget to any part of the windows 7 desktop.
    This problem happens with all the gadgets, so you can drag and drop the gadget you prefer.
    2. Automatically, something weird happen. You will see TWO COPIES OF THE SAME GADGET PLACED IN THE DESKTOP! One of those copies, is showing the controls to close it, etc. the other copy, doesn't show any controls at all and it is glued to the desktop, you cannot
    move it.
    3. This happens with all the gadgets you drag and drop to the desktop, all them are duplicated, appearing 2 times.
    4. When you restart, windows 7 doesn't remember the gadget, so the gadget will not be there anymore and will disappear.
    5. The Fix it 50617 and Fix it 50618 DON'T SOLVE THE PROBLEM.
    6. I did all these steps, and also don't solve the problem.
    http://support.microsoft.com/kb/2515657
    7. I tried other solution people is talking about in forums, registering the following DLL
        regsvr32 msxml3.dll
        regsvr32 scrrun.dll
        regsvr32 jscript.dll
    ALSO DON'T SOLVE THE PROBLEM.
    8. Restoring the system to the last point, ALSO DONT WORK. The last point was created in November 16th, 2011 and I tried to restore the system to that point and also don't solve the problem.
    I DONT KNOW WHAT TO DO.
    How may I solve this?
    I'm running Windows 7 Ultimate 64 bits
    Thanks

    SOLUTION FOUND
    This problem is caused by a certain gadget that is presenting incompatibility problems with Windows 7 gadgets, and it's affecting the behaviour of the other gadgets.
    SOLUTION TO SOLVE THE PROBLEM.
    1. Uninstall ALL, ALL gadgets in your windows 7, except those that comes by default with windows 7: Clock, Calendar, Money, Puzzle, Presentation (pictures), RSS News
    2. To uninstall a gadget press with the right button of the mouse over the desktop, select in the menu Gadgets, then click over the gadget you want to uninstall to select it, then press with the right button of the mouse and select uninstall. Do this for
    all the gadgets, except those coming by default with windows 7
    3. When the task be finished, restart your computer
    4. Now you will see all the gadgets are behaving perfectly, and you can install also new gadgets without problems.
    Try to avoid to install gadgets that could show a weird behaviour or incompatibility problems.
    Thanks

  • Socket Programming Problem

    I am using multi threading with socket programming. One thread uses socket's output stream to send the data and the other thread keeps waiting for the data to arrive from that socket's input stream.
    Now when the readLine or readObject is excuting on the receiver thread it will be blocked untill data arrives. In which case sending thread will not be able to send the data.
    Now is there any way to make the readLine or readObject method non blocking?
    Please advise ASAP
    thnks

    Below is an example of a simple blocking multi-threaded client program that connects to google. I don't believe I've ever experienced a problem like you're describing before while dealing with Java sockets; perhaps this will give you an idea about what's going wrong. One thread reads from stdin, the other (the main-thread of execution) reads from the socket and writes to the screen.
    java Test
    Then do a GET request to the HTTP server:
    "GET / HTTP/1.0"
    Then press return again and watch it send you google's root page.
    import java.net.*;
    import java.io.*;
    class Test
        Test()
         try
              Socket mySocket = new Socket("www.google.com", 80);
              BufferedReader myReader;
              final BufferedWriter myWriter;
              myWriter = new BufferedWriter(new OutputStreamWriter(mySocket.getOutputStream()));
              Thread myThread = new Thread()
                   public void run()
                       System.out.println("here");
                       try
                       BufferedReader inputReader = new BufferedReader(new InputStreamReader(System.in));
                       String str;
                       while((str = inputReader.readLine()) != null)
                            myWriter.write(str);
                            myWriter.write("\n");
                            myWriter.flush();
                       catch(IOException e)
                        System.err.println("Error reading from stdin.");
                        System.exit(-1);
              myThread.start();
                       System.out.println("there");
              myReader = new BufferedReader(new InputStreamReader(mySocket.getInputStream()));
              String str;
              while((str = myReader.readLine()) != null)
                   System.out.println(str);
         catch(IOException hostExcep)
              System.out.println("Host terminated the connection!");
              hostExcep.printStackTrace();
        public static void main(String args[])
         new Test();
    }

  • Strange problem with SSL Sockets using more than 10 Clients

    Hi
    I�m using Jsse ( JDK 1.4.2_06 ). I have coded a Client/Server Applikation acting over SSLSockets or over unsecured Sockets. If I use unsecured Sockets everthing works fine, but if I use SSLSockets for the Connection and about 20 Clients, the Clients often can�t connect to the Server and the following Exception was thrown:
    java.net.ConnectException: Connection refused: connect
    Could it be that there is some strange problem with SSLServerSockets relating to this phenomenon?
    If I use only a few Clients the Exception occurs never or only sometimes.
    Has anyboby an idea what is happaning there?
    Regards Chrisli

    Hi
    From the description of your scenario, you have coded your own server side of the application. I would advise that you consider moving your application to run under Tomcat framework and test if you still get the same exception.

  • TS3297 when i try to open itunes store error comes up saying windows experienced a problem and program stopped working

    can some help me everytime I try to open itunes store an error comes up saying windows experienced a problem and program stopped working. Itunes opens this just happens when I go to the store

    Hello Ducati848,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    iTunes for Windows Vista or Windows 7: Troubleshooting unexpected quits, freezes, or launch issues
    http://support.apple.com/kb/ts1717
    Best of luck,
    Mario

  • Strange Problem with windows form in SBO

    Hi all
    I encountered a strange problem
    I have a standard .net windows form that I am activating from a menu in SBO
    In the test Env. in our office the form always shows on top, whoever in the customer site first time you activate the menu the form appears correctly on top but when you close the form and press the menu again the form will appear "behind" the SBO.
    The form will appear on top only the first time you use it.
    The form is set to TopMost true
    I also tried using the user32.dll functions of SetFocus and SetForgroundWindow
    (I put them in the Activated event of the form)
    But it made no difference – first time form on top - the rest the from is behind
    The form is run on a separate thread and as I said works perfectly in the test Env.
    I am using .net 2005 with SBO 2005
    Any Ideas ?
    Thanks
    Ronny

    Hi Roni,
    I think you will find the answer to your question in this thread.
    https://forums.sdn.sap.com/click.jspa?searchID=3636651&messageID=844077
    Regards,
    Felipe

  • My dreamweaver cs5.5  on window 7started working stop  showing message  A problem caused programe to

    my dreamweaver cs5.5  on window 7started working stop  showing message  A problem caused programe to stop work correctly       

    What's the error message you received?
    What do your logs tell you?
    What were you doing just before you got the error message?
    Nancy O.

  • Strange problem: different hierarchy in InfoObject and RSSM hierarchy auth

    Dear Experts,
         I faced a strange problem: we had defined hierarchy on InfoObject 0ORGUNIT, for example, Organization unit: 50106592 under company A department AA.
         When we define hierarchy authorization via Tcode:RSSM ( we still not migrate to new authorization conception), when I search OU:50106592, it was found under "not assignment" .
         I can not understand why it appear different hierarchy, anyone can help me ?
    Regards
    Jie

    Hi Sushant,
    I went through the note, but we do not have any variable on the hierarchy. Its a navigational attribute which is restricted on Hierarchy.
    Thank you,
    -Jaimin

Maybe you are looking for

  • HT1222 Hi there just bought new iPad mini and can't get iOS 7 to update on it???

    Help can't seem to update my new iPad mini to IOS 7 x

  • Create PDF which does not allow to print

    My customer would like to use smartform HR_ESS_PAYSLIP_TO_PDF. The requirement is to convert the payslip to PDF, not allow to print the PDF. The <b>no print</b> information should be included in the document itself. I know this is generally possible

  • PreCalculated  Web Templates

    Hallo, I recently had to setup some precalculated web templates to improve query response time for users. But I have some doubts which could not be addressed even after I referred to course materials which I used when attending BW course a year back.

  • Black bars on youtube videos coming from adobe premiere elements 10?

    Every single video that I have edited on this programme, once saved, has come up on youtube with the black bars either side of it. I've tried to fix it but havent been able to. I believe its something to do with the setting that I saved it as but I'm

  • Book mark

    Hello, I am trying to execute a bookmark I am getting an eroor Web application terminated .. Error.. Diagnosis The system had to terminate processing of the Web application. The reason could be that the system was no longer able to find the Web appli