Socket open to inavailable IP takes too long time

Discussion in 'Java' started by Son KwonNam, May 12, 2004.

  1. Son KwonNam

    Son KwonNam Guest

    On JDK 1.3(I HAVE TO use 1.3.. T.T).

    When I open a socket to an IP which doesn't exist(for example
    192.168.34.13 which does not exist), It takes too long time - almost
    5~10 minutes.

    I open a socket in a JSP page, when a lot of people try to open the page
    and the IP to connect disapears(it disapears because of network
    problems), the WAS goes down. because of alot of socket connections are
    opened and continue trying to connect too long time.

    I just want that the WAS doesn't fail and give customers an error message.

    Is it possible to stop socket connection after 10 secs or some secs by
    OS(Unix especially HP-UX) settings?

    Or any other solutioin?

    Thanks.

    --
    ** Son KwonNam
    http://kr.blog.yahoo.com/kwon37xi

    Please DO NOT reply to this message's email address.
    The address is fake.
     
    Son KwonNam, May 12, 2004
    #1
    1. Advertising

  2. Son KwonNam

    Rob Shepherd Guest

    Son KwonNam wrote:
    > On JDK 1.3(I HAVE TO use 1.3.. T.T).
    >
    > When I open a socket to an IP which doesn't exist(for example
    > 192.168.34.13 which does not exist), It takes too long time - almost
    > 5~10 minutes.
    >
    > I open a socket in a JSP page,


    I don't know much about JSP but is it possible to have a previously constructed pool of
    network connections which you can use to connect your jsp to wherever....
    [assuming you connect to the same ip(s) every time]

    Your jsp then does not open the connection it merely selects (requests) one to use from
    the pool...

    That way if there are no free connections you can politely ask the user to try again later...

    and experiment with the max number of connections without unexpected results...

    I am also assuming you can have persistent Java Objects running behing your JSP's

    can you?

    Anyone.. Anyone.. Bueller.. Bueller..

    Rob
     
    Rob Shepherd, May 12, 2004
    #2
    1. Advertising

  3. Son KwonNam

    Roedy Green Guest

    On Wed, 12 May 2004 18:29:01 +0900, Son KwonNam
    <> wrote or quoted :

    >When I open a socket to an IP which doesn't exist(for example
    >192.168.34.13 which does not exist), It takes too long time - almost
    >5~10 minutes.


    I discovered that Panda antivirus firewall was doing something odd. It
    was letting the Opera browser through, but only after a minute delay
    the first time. It turned out my configuration for Opera had not been
    updated to reflect its new home directory.

    Perhaps your firewall is doing something similar.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, May 12, 2004
    #3
  4. Son KwonNam wrote:
    > On JDK 1.3(I HAVE TO use 1.3.. T.T).
    >
    > When I open a socket to an IP which doesn't exist(for example
    > 192.168.34.13 which does not exist), It takes too long time - almost
    > 5~10 minutes.
    >
    > I open a socket in a JSP page, when a lot of people try to open the page
    > and the IP to connect disapears(it disapears because of network
    > problems), the WAS goes down. because of alot of socket connections are
    > opened and continue trying to connect too long time.
    >
    > I just want that the WAS doesn't fail and give customers an error message.
    >
    > Is it possible to stop socket connection after 10 secs or some secs by
    > OS(Unix especially HP-UX) settings?
    >
    > Or any other solutioin?
    >
    > Thanks.
    >


    You could start another thread - call the socket constructor in another
    thread and than wait with a 10-second timeout. If you don't get the
    call-back from the socket constructor thread then send an error page
    and set a flag to the socket constructor telling it "too late" and that
    it should close and die ASAP.

    You might be able to set a connect timeout on an unbound socket before
    trying to connect if you're using 1.4. I haven't had a chance to look in
    detail at that stuff.

    Steve
     
    Steve Horsley, May 12, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chuck Swart

    bata takes too long with sun

    Chuck Swart, Sep 13, 2003, in forum: VHDL
    Replies:
    1
    Views:
    493
    Chuck Swart
    Sep 13, 2003
  2. Replies:
    16
    Views:
    703
    Thomas Hawtin
    Sep 14, 2005
  3. Replies:
    0
    Views:
    607
  4. elsa
    Replies:
    11
    Views:
    386
    Steven D'Aprano
    Feb 2, 2010
  5. JVRudnick

    CDOSYS executes but takes TOO TOO long?

    JVRudnick, Feb 20, 2008, in forum: ASP General
    Replies:
    13
    Views:
    305
    JVRudnick
    Feb 28, 2008
Loading...

Share This Page