Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Socket open to inavailable IP takes too long time

Reply
Thread Tools

Socket open to inavailable IP takes too long time

 
 
Son KwonNam
Guest
Posts: n/a
 
      05-12-2004
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.
 
Reply With Quote
 
 
 
 
Rob Shepherd
Guest
Posts: n/a
 
      05-12-2004
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
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      05-12-2004
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.
 
Reply With Quote
 
Steve Horsley
Guest
Posts: n/a
 
      05-12-2004
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Having compilation error: no match for call to ‘(const __gnu_cxx::hash<long long int>) (const long long int&)’ veryhotsausage C++ 1 07-04-2008 05:41 PM
File > Open takes a long time to show locations Franky Windows 64bit 1 04-17-2008 06:54 PM
Allow Roles name too long?? AD groups too long? Integrated Security wildman@noclient.net ASP .Net 0 03-10-2008 03:47 PM
CDOSYS executes but takes TOO TOO long? JVRudnick ASP General 13 02-28-2008 03:03 PM
XP takes a long time to open Johnnie Scott Computer Support 5 10-28-2005 02:58 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57