LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 09-16-2008, 04:12 PM   #1
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware 13.37 and 13.1
Posts: 393

Rep: Reputation: 63
3 minute delay with socket in java


I noticed that whenever a java application opens a socket there is a several minute delay. For example, netbeans takes ages to start up as it goes off to look for updates. I also noticed this in java apps that I've written.

For example, this simple test code:
Code:
            for (int i = 0; i < 5; i++) {
                long time_start = System.currentTimeMillis();
                Socket s = new Socket("192.168.1.1", 80);
                long time_end = System.currentTimeMillis();
                System.out.println("Time to open socket (ms): " + (time_end - time_start));
                s.close();
            }
prints out
Code:
Time to open socket (ms): 189088
Time to open socket (ms): 5
Time to open socket (ms): 2
Time to open socket (ms): 3
Time to open socket (ms): 2
The there is always a ~3 minute delay on the first opening of a socket in a java app. The above behaviour also occurs if the IP is outside my LAN.

I'm running slackware 12.1 behind a wireless router with NAT at home. I've tried static IP and DHCP and playing with the hosts and resolv.conf files, but to no avail. At work with the same laptop (wired router, NAT and different ISP) there is no problem.

Curiously, it worked fine at home and work when I was using the same laptop with slackware 11.

Any ideas would be most welcome before I remove all the hair on my head.

Edit: Seems to be this issue - http://bugs.sun.com/bugdatabase/view...bug_id=6483406

Last edited by mcnalu; 09-16-2008 at 04:53 PM. Reason: more info
 
Old 09-24-2008, 02:08 AM   #2
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware 13.37 and 13.1
Posts: 393

Original Poster
Rep: Reputation: 63
Problem solved. I had blacklisted ipv6 - it seems that was causing the 3 min 9s delay. I removed ipv6 from /etc/modprobe.d/blacklist and all was well again.

I had blacklisted it because of 5 sec delays in dns lookup (experienced before in slackware 11), but it seems that isn't a problem in my new slackware 12.1 setup.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple Java Socket Question Hady Programming 1 01-08-2007 02:37 AM
Run a java socket server gloveny Linux - Newbie 6 12-11-2006 07:38 AM
5 to 10 minute delay connecting to Internet fuzzybud Linux - Networking 1 09-19-2006 03:45 PM
connection between java socket and unix socket sathishkumar Programming 1 01-10-2006 03:21 PM
5 minute delay mounting remote NFS dunk05 Linux - Networking 1 02-06-2002 09:56 AM


All times are GMT -5. The time now is 11:46 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration