Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 09-16-2008, 05:12 PM   #1
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware 13.37 and 13.1
Posts: 398

Rep: Reputation: 64
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:
            for (int i = 0; i < 5; i++) {
                long time_start = System.currentTimeMillis();
                Socket s = new Socket("", 80);
                long time_end = System.currentTimeMillis();
                System.out.println("Time to open socket (ms): " + (time_end - time_start));
prints out
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 -

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

Original Poster
Rep: Reputation: 64
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.


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 03:37 AM
Run a java socket server gloveny Linux - Newbie 6 12-11-2006 08:38 AM
5 to 10 minute delay connecting to Internet fuzzybud Linux - Networking 1 09-19-2006 04:45 PM
connection between java socket and unix socket sathishkumar Programming 1 01-10-2006 04:21 PM
5 minute delay mounting remote NFS dunk05 Linux - Networking 1 02-06-2002 10:56 AM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:49 PM.

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