Socket doen't detect broken network.

the following server program just keeps on running when I unplug the clients network kabel. (client is just a telnet)
If I send to the socket outputstream he doesn't detect the broken link.
jdk 1.4.1
linux.
java.net.ServerSocket serverSocket= new java.net.ServerSocket(3201);
java.net.Socket socket = serverSocket.accept();
java.io.DataOutputStream lS = new java.io.DataOutputStream(socket.getOutputStream());
while(true)
lS.writeUTF("test");
lS.flush();
System.out.println("testing");
Thread.sleep(1000);
}

yep, pain in the neck isnt it...
reason is that TCP/IP is not a permanent type of connection, rather a serise of packets between 2 sockets, if you terminate the connection "properly" then an EOF is sent by the closing Socket, if however there is a network failure then it can never be recieved The expected work around is with Socket.setSO_TIMEOUT, but this has been reported to be unreliable and the standard method for detecting a broken connection is to write your own timeout and either close the socket, or attempt to write something to it (which will throw an IOException) if it has failed

Similar Messages

  • X200 not detecting wireless networks

    Hello, 
    I have a ThinkPad X200 running windows XP, with an Intel Wifi Link 5100 AGN network card.
    It used to be working great, but about 3 weeks ago it stopped detecting wireless networks. 
    Since then it states: "No wireless networks were found in range."
    There are wireless networks around, this has been confirmed by using other computers. In fact, the laptop used to connect just fine. Just seemed to go out one day.
    The driver appears to be the newest one, (1/22/2012). 
    And looking in the support, the "allow the computer to turn of this device to save power" button is unchecked.
    It has been repaired and uninstalled. And seems to think the device is working properly.
    The only thing i think is that the receiver on the card is broken somehow and needs to be replaced.
    Any ideas would be very much appreciated! Thanks!

    Try resetting the SMC and PRAM
    MacBook Pro 
    Laptops with a battery you can remove 
    Shut down the computer.
    Disconnect the MagSafe power adapter from the computer, if it's connected.
    Remove the battery.
    Press and hold the power button for 5 seconds.
    Release the power button.
    Reconnect the battery and MagSafe power adapter.
    Press the power button to turn on the computer.
    Resetting NVRAM / PRAM
    Shut down your Mac.
    Locate the following keys on the keyboard: Command (⌘), Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    Turn on the computer.
    Press and hold the Command-Option-P-R keys before the gray screen appears.
    Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    Release the keys.

  • IPad2 wifi no longer detecting some networks

    Hello, my old iPad 2 is detecting some networks in the house but not others.  I have Uverse Motorola ngv510 and using wireless, it has even an additional Cisco WAP for the wireless uverse receivers.  My old iPad sees the Cisco WAP but not the standard house wireless, it won't see the HP wireless printer, but the neighbors WAP no problem.  My iPad Air sees all of them, it's like the old iPad 2 is just filtering out some WAPs, I've tried manual connections, restarting the Motorola, moving it to just N band, I can't get this old iPad 2 to see my wireless network.
    I'm going to take it to work Monday, maybe it will see that one there and I can do an update.  It's running iOS 7.0.4
    Anyone have this problem that might be able to assist?

    Howdy George,
    It sounds like you are not seeing all available Wi-Fi networks. I would use the Wi-Fi troubleshooting from the following article, named:
    iOS: Troubleshooting Wi-Fi networks and connections
    http://support.apple.com/kb/TS1398
    Restart your iOS device.
    Turn your Wi-Fi router off and on2. If your ISP also provides cable or phone service, check with them before attempting this step to avoid interruption of service.
    Update your device to the latest version of software.
    Unable to locate a Wi-Fi network
    Verify that the network is available by tapping Settings > Wi-Fi and choosing from the available networks.Note: It may take a few seconds for the Wi-Fi network name to appear.
    Move closer to your wireless router (access point) and attempt to locate the Wi-Fi network.
    If you do not see the network you would like to join, you may be attempting to connect to a hidden network. Learn how to join a hidden network.
    Supported Wi-Fi configurations vary by iOS device model. Find out which standards your device supports3.
    Reset network settings by tapping Settings > General > Reset > Reset Network Settings. Note: This will reset all network settings including:
    previously connected Wi-Fi networks and passwords
    recently used Bluetooth accessories
    VPN and APN settings
    Thank you for using Apple Support Communities.
    Regards,
    Sterling

  • How can I get applications to detect a network scanner?

    Running 27" iMac with OS-X 10.7.2, all Software Updates are installed.
    Epson Workforce 630 attached via ethernet network. Driver is current at 8.61.
    System Preferences>Print and Fax lists the printer and has a tab for the scanner. Scanning via this interface works fine.
    Preview will detect and scan without problem, but Image Capture does not detect the scanners. Adobe Acrobat Pro 9 and Pro X do not detect my network scanners. Adobe support is no help. No problems with Apple products appear to be theirs, ever.
    Epson drivers according to their website are installed through Software Update -- current.
    But Acrobat will not detect the Epson over the network.
    Note that my wife's iMac OSX 10.6.8 has the same problem.
    Anybody got a clue?
    Thanks!
    Norm

    Surfing Seapearl wrote:
    ...I pay extra via verizon, so I know it's not the slowest, and I would be aware due to other download speeds. For example, I was able to download adobe flash in a reaonable amt. of time...
    You may be paying extra but what speed are you actually getting? Open Activity Monitor, click the Network button at the bottom and watch the Data received/sec speed while you're downloading different things. That will give you the actual transfer rate, not the advertised transfer rate.
    Something like Adobe Flash shouldn't take long because it's only about 18 MB; how big is something that seems to lag? Is your internet connection wireless or are you using an Ethernet connection with a Thunderbolt to Ethernet adaptor? Wired is almost always faster. And with Mavericks being over 5 GB, it'll take a while under the best of circumstances, especially since the transfers I've observed of it don't run anywhere near what a fast connection is capable of.

  • IMac no longer detecting any networks...

    Hi again all...
    My 24 inch white iMac recently went in for repair after having graphics issues (no other issue ever, everything perfect). It came back, switched it on, runs fast again and has no graphics issues.
    However, Airport now does not seem to be detecting ANY network at all. Normally it would pick up my home network (router in the next room), as well as 1-2 other networks which are likely from other houses nearby. This has always been the same for the life of the computer. My MacBook has absolutely no issues detecting my home network as well as other networks, as per usual.
    I have tried resetting the SMC, PRAM, removing and re-adding Airport, running Network Diagnostics, etc but it just cannot find anything at all. I even tried messing with my router a bit by changing the security a few times, the MacBook detected it fine again, but nothing on the iMac. Same thing after trying another router too. Also, the Airport card seems to be detected fine in System Profiler.
    I cannot seem to figure out what's causing this and how to resolve it. Please can anyone advise me on what else I could try and what the problem could be?
    Thanks, hope you guys can help!

    HI,
    Try changing the Airport Channel.
    Open AirPort Utility (Applications/Utilities)
    Select the device you’re setting up on the left and then click Manual Setup. Enter the base station password if necessary.
    Click AirPort in the toolbar, and then click Wireless.
    Choose a new channel from the Channel pop-up menu.
    If that doesn't help, go to /Library/Preferences. Move all the files in the System Configuration folder to the Trash, restart the iMac.
    If nothing above has helped, try the Airport Troubleshooting Guide here.
    Carolyn

  • My macbook pro will no longer detect my network, but my iphome does

    i was using my macbook when suddenky the option ti connect to my wifi network is no longer availabke. i have reset my router, and my iPhone still detects the network. idk how to solve this!

    Try resetting the SMC and PRAM
    Intel-based Macs: Resetting the System Management Controller (SMC)
    About NVRAM and PRAM
    Try another cable

  • My iPhone no longer works with my wi-fi network.  It detects the network but can't communicate, even though it did so until today for months.

    My iPhone no longer works with my wi-fi network.  It detects the network but is unable to communicate, even though until today it worked great for months.  The network is Verizon FiOS Internet on an M1424WR router.  PCs and iPad continue to work with the same network without any problem.  Any ideas?

    have you upgraded to the new ios5 software? if so that could be the issue and contact apple.

  • MacBook pro does not detected wireless network?????

    Hi! I have an airport express that provides the wireless network for the house. My iMac and iBook as well as iphone have no problem detecting the network. But the network does not show up in the drop down list that shows up when I turn the airport on. When I click on "other" and type in the information that way, the connection times out.
    Any suggestions would be appreciated!
    Thx!

    I have a similar problem. When I set the network to not be closed, My MacBook Pro finds and connects when I return from being away. When I set the network to be "closed", it will not connect automatically (I have checked "Remember and network this computer has joined" & "Remember this Network ") it will not join automatically. However, when I enter the name and password, it connects and all is well. My iPhone will automatically connect regardless of the "closed" being checked or not. Any suggestions? I would prefer to retain the "closed" setting for extra security.
    Thanks,
    Bruce

  • Airport not detecting the network but my cellphone detects

    hi...
    i am using 13 inch macbook pro.....yesterday night my wifi network was working fine,but suddenly the airport has stopped detecting the network......plz suggest me the solution.....thanx a lot...
    Regards,
    Sorabh
    Message was edited by: sorabh arora

    Hello,
    I see that you posting from India. I had this same problem a few months ago when I was out of the US. The iPhone can recognize wireless networks that are broadcasting on a broader range of wireless channels than my MacBook Pro. I was in France and my iPhone would connect to the wireless network but my MacBook would not even detect it. This was because the wireless network was broadcasting on channel 13. This is a normal channel in many parts of the world but we are not allowed to use this channel in the US. My MacBook can only connect to networks broadcasting on channels 1 through 11 on a 2.4GHz network. Try checking your router to see what channel it is broadcasting on and change it to a channel between 1 and 11 and see if that helps
    Regards,
    Sean

  • Iphone 4s won't boot on and itunes doens't detect it when on battery. Plug it in and Apple logo appear then disappear, try to recover, but there's a 1602 error. Is it dead?

    Iphone 4s won't boot on and itunes doens't detect it when on battery. Plug it in and Apple logo appear then disappear, try to recover, but there's a 1602 error. Is it dead?

    Its weird, when I plug it into wall AC, I was able to boot into the home screen, but there's wifi cant turn on. Plug out the phone turn off immediately. I tried to jailbreak it with snowbreeze because someone has the same problem with his iphone 4, but snowbreeze doens't work with iphone 4s.

  • Ipod not detecting any networks except mine

    When I first purchased my iPod Touch, it would consistently detect a list of approximately 10 wireless networks (when I was sitting in my living room). My laptop detected the same 10 wireless networks. About a month ago, my iPod stopped detecting any of these other networks. It would still detect my own wireless network, but only if I was in the same room as the router. And even though it would detect my network, it would rarely connect to it. I took my unit back to the store, and the store sent it out for "repairs". I received a refurbished unit.
    The refurbished unit seems to connect to my network a little more frequently, and seems to detect it from a little further away (like upstairs) but it still doesn't detect any of the multiple networks that are in my area.
    It also doesn't detect any networks when I take it downtown to the office district (and when I first purchased my iPod, it would detect like 40 networks when I was downtown).
    What's the deal? And how do I fix this?

    I have the same problem.
    See http://discussions.apple.com/thread.jspa?threadID=1822349&tstart=0
    Baz

  • Network Manager fails to detect unsecured network.

    My current laptop uses a clean install of Arch Linux with the latest gnome-shell release. NetworkManager has no problem connecting to the wireless networks at home, but the problem I have is at college.
    My college has an open wireless network; sometimes it fails to show in network-manager-applet. That's the first problem. The second problem, If it does show, it'll fail to connect. In order for me to connect, I had to install the iw package and type sudo iw eth1 connect <network-name> after it fails. Only then will it connect.
    How do I fix this so that NetworkManager will stop acting up?
    Here's the wireless adapter installed and the driver it's using. (I use AUR's broadcom-wl package because it can detect more networks and doesn't act up for me.)
    [dbdii407@laptop ~]$ lspci | grep Broadcom
    07:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01)
    [dbdii407@laptop ~]$ lsmod | grep wl
    wl                          2558087  0
    lib80211                3949       2    wl,lib80211_crypt_tkip
    cfg80211              177058    1    wl
    After connecting through iw
    Thank you very much!
    Last edited by dbdii407 (2012-10-31 18:55:47)

    Maybe it is a "mixed interface issue", if that's the case, then you should read this: https://wiki.archlinux.org/index.php/Ud … ork_device
    Hope it helps.
    Last edited by RozenTensai (2012-12-09 18:40:33)

  • Problem to detect Wifi networks. I restored without back up and it doesn't work. suggestions?

    Problem to detect Wifi networks. I restored without back up and it doesn't work. suggestions?

    I detected one time networks with the trick (air plane mode on, power off, sim card out, power on, sim card in, air plane mode off...). since nothing. I think it's a software problem. suggestions ?

  • Windows Can't Detect Wireless Network

    I have a windows xp laptop which can't detect the wireless network i've created with airport express- but it seems to be able to detect other networks around the area.
    My two other machines (one macbook and the other xp) does pick up the network.
    It seems like everything is working fine. 2/3 computers can pick up the signal, but just one of the computers can't! And i've repaired and reinstalled the driver for the wireless card, but it just won't detect the airport express signal!

    That link does not help.
    The network card on my windows xp machine works fine. It can detect other networks in the building and works at other WiFi spots.
    I think its something to do with somthing in XP and Vista that is preventing it from detecting Airport Express' signal.
    I've increased signal robustness- still doesn't work.
    I've removed the password- still doesn't work (obviously not a security problem).
    I've updated the software- still doesn't work.
    I'm very confused as my XP machine did detect it initially and connected to it successfully earlier this year, but it doesn't anymore.
    It seems like the network can be detected by some windows machine but not others???

  • Windows did not detect any networking hardware, Windows 7, New Hard Drive

    Message "Windows did not detect any networking hardware"
    Satellite P505 S8980 Windows 7 Home Premium.
    I replaced the Toshiba 500 GB HD with 500 GB Seagate.
    Device Manager icon for any device with yellow exclamation mark,
    Click on "Update Driver".  Lan eNet details as follows:
    Antheo - R8132 PCI-E Fast Ethernet Controller (NDIS 6.20)
    Browse to the folder where the setup program has the driver...
    Message: "The best driver software is already installed."
    (But the yellow exclamation mark still harasses me.)
    --- Go to "Setup new connection" ---
    "Choose a connection option"
    Click on "Connect to the Internet"
    Response: "Windows did not detect networking hardware"
    As near as I can tell, that translates from error 0x8E5E0247
    I have this same error on other yellow exclamation marks respective of what kind of device it is.
    => To test my sanity, I put the old hard drive (same size) back in and except for the impact of slowness due to error retries, everything works okay.
    Note:
    Same issue (hardware not detected) for Video adapter and Audio.
    I bought new USB Wireless adapter to test, and the driver installed but not activated because "not digitally signed", and that same issue fits all the above hardware.  I down loaded them from Toshiba, and they are confirmed installed, but not accepted with digitally signed.  I have uninstalled and reinstalled with same results.
    Solved!
    Go to Solution.

    I'm discovering I am not as well as I thought... running on the  AF hard drive which was built with a copy drive from old format drive which was the product of system recovery disc set.
    Review for context: Advanced Function HDD
    Scenario that exposes harm caused by cloning data from 4K blocks drive to 512 bytes blocked drive (AF)
    Toshiba supplied Windows-7 System Restore Discs: to factory state
    Then I built the Windows-7 Repair  Disc... used later.
    Hard drive was replaced when it caused SMART warning at every system boot.
    Acronis was only utility that quickly detected problem (3 sectors had permanent read errors.) Active@Disk Image and Power Quest Drive Image (Ghost) did not detect the issue.
    I tried Seagate 500 GB and Western digital 500 GB HDD drives as copy target.
    That new drive would not boot: "Required source not found"
    Booted My newly created Windows-7 repair disc, and used to to fix startup.
    See images.
    That worked and then the ST9500423AS disc booted.
    Now... next day I discovered Window Update is not working.
    I get message:
    Windows Update cannot currently check for updates, because the service is not running. You need to restart your computer.
    I ran Microsoft Fixit for updates.  It says it fixed two items.
    I still have the problem.
    The service shows "started"
    Control Panel/ ACTION Center/ Maintenance/ Check for Updates
     "No action needed"
     "Windows Update does not require any action"
    I checked  Update History...
    ... It is empty, else window is vacant... blank.
    Soooo..... for a sanity check, I swap out hard drive; go back to the old format (which is the one I copied).
    It works!  7 updates to install, including SP1... but I did NOT install them.
    Switch back to the AF drive... Update doesn't work. I am broke again.
    Is this another strange problem caused by the Advance Format issue?
    What to do?
    By the way... I did install an Intel storage Matrix driver  update, but I do not have RAID chip, so that driver is not for me... unless I missed out on something.
    Carl

Maybe you are looking for