Checking status of a dial up connection

I'm trying to develop a program that checks whether a dial up connection has been established. I'm using a thread to attempt to open a URLConnection every 5 seconds.
If opening the connection succeeds the connection status is set to true. If an exception occurs the status is set to false. In general this approach works fine, with one exception.
If I start the thread with a dial-up connection established the thread sets the status to true. When the dial up is then disconnected it sets it to false. This is just what I need.
However if I start the thread the status is set to false and stays that way even when the dial up has been established. It's very strange that the method works fine one way and doen't work at all another way. If anyone can clear this up i'd appreciate it
Here's the code
import java.io.*;
import java.net.*;
public class ConnectionStatusThread extends Thread
     public static boolean INTERNET_CONNECTED = false;
     public ConnectionStatusThread( String name )
          super( name );
     public void run()
          System.out.println( "ConnectionStatus Thread Running" );
          while ( !Thread.interrupted() )
               URL gfr = null;
               URLConnection conn = null;
               try
                    gfr = new URL( "http://www.goodfridayrobotics.com/" );
               catch ( MalformedURLException meu )
                    System.err.println( meu.getMessage() );
               try
                    conn = gfr.openConnection();
                    conn.connect();
                    INTERNET_CONNECTED = true;
               catch( IOException ioe )
                    INTERNET_CONNECTED = false;
               System.out.println( "Connected = " + INTERNET_CONNECTED );     
               //conn = null; doesn't make any difference if set to null
               //gfr = null;
               try
                    Thread.sleep(5000);
               catch(InterruptedException e)
                    System.err.println( "InterruptedException" );
                    System.err.println( e.getMessage() );
}

It's ok everyone I changed the URL + URLConnection to a socket and that solved the problem

Similar Messages

  • I lost the dial up connection dialog box. I unchecked a check item in the dial connetion box. How do I get the dial up connection back?

    I established a dial up connection by updating to automatic the remote managers and telephony in administrative tool services area on my XP system according to firefox help instructions.
    At first I had a dial up connection but I unchecked an item in the
    dial up connection box. I am not sure what I unchecked or toggled
    off. I then lost the dial up connection. I need to get the dial connection dialog box back. What needs to be done
    Thank you.

    I see no direct connection.. a printer and the computer setup for internet are not related.
    But it sounds like the router in the wife's office is now in the wrong mode..
    If you have an existing main router replace the second router for a switch .. that is the easy way.
    Otherwise you need to bridge the router if it has that option.. most do not. Or use wan bypass.. where you turn off the dhcp server in the router and fix its ip to match the range of the main router.. this is the hassle of using router as a switch.
    BUT I am making a huge number of assumptions.
    What I need is the full network layout.. a quick picture would help.
    I need main modem.. main router.. (maybe same box or different).. make model and current IP address and how dhcp is setup.
    I need secondary router.. if that is what it is, IP and settings.
    I want the printer type and model. How it is connected.
    BTW I much prefer to see a network printer plugged into the network rather than usb.. it is only a matter of sorting the IP settings and driver pointing to the network rather than local.
    Or you should think of it as a broken washing machine and call the technician.. who could fix the whole lot in an hour.

  • View dial-up connection rate/speed?

    Hello,
    I know within Windows when using a dial-up connection, you're able to view the connected speed (Ie: 46.6kbps) by going into the connection status menu.
    Under OS X, I can't seem to find this option? I've just moved house and am relegated to using a dial-up connection until my ADSL is connected. To save on phone calls, I've stopped the Macbook from going to sleep until I shut it down at night (to stop the modem hanging up) - I'm just wondering if there's a way to check what the approximate connected speed is? I've checked under System Profiler, but to no avail.
    Regards,
    Brayden

    Activity Monitor shows peak speed above the graphic display of network activity. System Profiler (which is what you reach from About This Mac>More Info) shows IP numbers and DNS numbers and so on for my Airport connection but not speed (it does show the speed of the connection between the Mac and the Airport base station but that's no help): I can't test dial-up.
    However there may well be third-party programs which will do this: I have Intego's NetBarrier which displays instantaneous speed, though it's hardly cheap: you could look round for something simpler (and cheaper).

  • Where is the option to set up a dial-up connection in firefox 12?

    I am using a G3 USB modem as my internet connection - Firefox 12 seems to think I'm connecting through a network when I'm using a dial-up connection.
    IF I open IE8 first - which automatically dials the connection and then open Firefox 12 connect quite happily BUT if I just open Firefox 12 I get no connectivity,
    I want to use Firefox 12 cos I dislike IE8 - how do I tell Firefox 12 that it is meant to auto-dial a dial-up connection?

    Hi Tobbi,
    Thank you.
    I've followed the instructions, Rebooted, opened Firefox 12 and got the 'No connection' error again.
    Checked in services - those 3 are running - so I guess the answer is NO. no help but thanks
    Also, it says no auto-disconnect option - download 'hang up' but that link seems to be dead - Firefox can't find the server at www1.physik.tu-muenchen.de.
    Any ideas please?
    Thanks again
    Droidware

  • Dial- up- Connection pop-up

    I upgraded from WRT54GX2 Router & WPC54GX4 Notebook Adapter to a WRT160N Router & WPC600N Notebook Adapter. Installation was a breeze, everything work great except LELA. LELA works somedays. My problem is now I get the "Dial-up-connection" pop-up menu which causes IE to switch to "Work offline". I just cancel the "Dial-up-connection" menu, then another pop-up "Webpage unavailable while offline" which I also cancel, then uncheck "Work Offline" on the Internet Option menu. After all this, my Internet connection comes back until the pop-up menu appears again. Never had this issue with the WRT54GX2 or WPC54GX4. Does anyone have a solution to this annoying problem? 
    Operating system: VISTA Home
    (Mod Note: Edited subject to keep threads from stretching. Thanks!) 
    Message Edited by JOHNDOE_06 on 11-03-2008 06:00 AM

    Go to Tools > Internet Options > Connection > Check never dial a connection and delete any items from the list > OK. Open a new broswer and check.

  • How to automatically initiate a dial-up connection from Lookout and send an attachment

    Folks:
    I am trying to send (as an attachment) a spreadsheet file via email.
    How can I programatically (from Lookout) initiate the default dial-up,
    send the email (and attachment) and after success (btw, how do I
    measure this?), ... then close the dial-up connection.
    I am using 6.0.1 running on XP Pro (SP2).
    Thanks!
    Kevin

    Hi Kevin,
    Here are some documents that should get you started with setting up a dial-up modem in Lookout and sending an email:
    Dial-up modem settings for Lookout:
    http://zone.ni.com/devzone/conceptd.nsf/webmain/108f6fa501dc4a2e86256a6f00519bef?OpenDocument&node=D...
    Commands for communicating with a modem:
    http://digital.ni.com/public.nsf/websearch/8EC833DA692DFBA286256BA100020214?OpenDocument
    If you need to dial a number you will use the pager object (take a look at the links from this page as well):
    http://digital.ni.com/public.nsf/websearch/9123C2685B3B977F86256C02005E6CA2?OpenDocument
    Example of using Lookout Mailer object:
    http://venus.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?p_answer=&p_guid=B45EACE3E98156A4E034080...
    Lookout Mailer object troubleshooting:
    http://digital.ni.com/public.nsf/websearch/843FDCF3138EEEAE862569EA006DA113?OpenDocument
    Check out the Lookout help on the mailer object.  There is an attachment data member that you will use to point it to the file you want to attach to the email.
    Let me know if this helps at all.
    Regards,
    Bryan Snarr
    Field Engineer
    Northern California
    National Instruments

  • Flash accessing the Dial Up connection

    I'm new to the forums, so hello to everybody.
    I've got a project on my hands, an interactive kiosk. I've created the interface in Flash, but I have some issues I can't get past. First of all, I want to create an emergency call feature, where the user presses a button and the kiosk dials the emergency number (112 for Europe). Now, how can I make the Flash movie call upon Windows' dial up connection, dial a number, establish a connection then disconnect? I know that Flash can't use Windows services directly, so how can I accomplish this?
    My second issue is that I also would like to create a photo-shoot system, where the Flash movie takes a snapshot from the webcam, saves it as a file, then the user needs to input his email address and the file is sent by email as an attachment.
    I hope I've been clear enough. Any help would be much appreciated. Thank you.

    Hi
    Check out this link:
    http://www.adobe.com/devnet/mobile/articles/tel_url.html
    But i am not sure.
    Saransoft

  • How do I get rid of annoying dial-up connection boxes?

    The Dial-up Connection box appears every time I use my computer. (I don't use dial-up) Is there a simple way to get rid of this. It has only been for the last month or two. (I'm using Firefox)

    Hello tackettr, i think the question is not related with firefox, but check if the next is helpful : http://www.ehow.com/how_6760092_stop-microsoft-dial_up-connection-pop_ups.html
    thank you

  • Sharing the dial-up connection of a PC laptop--either wired, or wirelessly

    Hello, fellow Mac users! I just got my first Mac--a beautiful 1.83 GHz MacBook. I LOVE the switch to OS X from Windows XP.
    Anyway, here's problem:
    I am leaving on vacation, and, unfortunately the resort at which we are staying does not have Internet Access, so I am forced to use dial-up. Unfortunately, since I have heard very bad reports about the Apple USB Modem, I can't get a modem for the MacBook itself, so I will use my PC laptop's modem. The PC Laptop is a Windows XP Pro machine. So, here's the problem--try as I might, I just cannot get the darn PC laptop to share its dial-up connection; either over a ethernet cross-over cable, or adhoc Wi-Fi.
    So, please help me get this to work, or I will be forced to use a PC laptop to check e-mail, RSS feeds, and anything else online.
    Thanks in advance! (And thanks, Steve Jobs, for helping to create some of the best computers out there!)

    Here is from the help support on xp :
    Configure,a dial-up
    connection, click the connection that you want to
    configure, and then, under Network Tasks, click Change
    settings of this connection.
    Do one or more of the following:
    To configure dialing devices that your computer uses
    to make a connection (a modem, for example), phone
    numbers, host addresses, country or region codes, or
    dialing rules, click the General tab.
    To configure dialing and redialing options, or X.25
    settings, click the Options tab.
    To configure identity authentication, which is a way
    to help verify your computer’s identity when making a
    connection, data encryption (which codes the content
    so that it’s less likely to be readable by someone
    other than the intended recipient), or terminal window
    and scripting options, click the Security tab.
    To configure the remote access server that you want to
    connect to and protocols (the format that your
    computer uses to communicate with other computers)
    used for this connection, click the Networking tab.
    To turn Internet Connection Sharing on or off or
    configure your computer to establish a dial-up
    connection automatically, click the Advanced tab.
    When you run the
    Network Setup Wizard and enable Internet Connection
    Sharing, some protocols, services, interfaces, and
    routes are configured automatically. The following
    table describes these configured items.
    Configured item Action
    IP address 192.168.0.1 Configured with a subnet mask
    of 255.255.255.0 on the LAN adapter that is connected
    to the home or small office network.
    Autodial feature Enabled.
    Static default IP route Created when the dial-up
    connection is established.
    Internet Connection Sharing service Started.
    DHCP allocator Enabled with the default range of
    192.168.0.1 and a subnet mask of 255.255.255.0. Unique
    addresses in the range 192.168.0.2 to 192.168.0.254
    are allocated to private network clients.
    So try to use dhcp on your network setting or something between those range listed above with a cross over cable (make sure the cross over cable has good connection).

  • Enabling Create New Query and Personalize in Check Status

    Hi All,
    We followed below steps Enable Create New Query and Personalize in Check Status
    Go to the role of the user - PFCG - Authorizations - Change authorization data - Cross-application authorization objects - authorizations for Personal Object Work List (POWL) iViews
    Specified the application ID POWL_APPID - SAPSRM_E_CHECKSTATUS
    What should be done to enable define query and personalize for all users.
    We have changed the following settings -
    In activity POWL_CAT - '??' , POWL_LSEL-DISALLOWED - POWL_QUERY - ?? , POWL_RA_AL - ?? , POWL_TABLE - ??.
    With our current settings Create New Query and Personalize in Check Status appear but are disabled (greyed out)
    New Query Button appears but clicking on it produces no output.
    Nikhil
    Edited by: Nikhil Malvankar on Sep 12, 2011 5:57 AM

    You could the following to check if the Query still exists in the database:
    Open SQL Management Studio and connect to the SQL Server hosting the ConfigMgr database
    In SQL Managemnt Studio, Expand Database, Expand CM_YourSiteCode
    Expand tables and find the dbo.Queries table
    Right-click the dbo.Queries table and select Select Top 1000 Rows
    See if you can find your "ghost" Query
    Please note - it IS NOT supported
    to make direct changes to ConfigMgr database so I would properly call PSS on this one before you start getting creative.

  • Initiate a dial-up connection or detect whether I am connected to the net

    I want to initiate a dial-up connection from my java program and also to detect whether I am connected to the internet or not.

    well I am developing a proxy server and I want to add
    a feature of dial-up demand that detects the current
    connection status and if not connected to the net then
    call the dial-up dialers in dial-up networking folder
    and then connects to the internetI'd say it works like I wrote earlier:
    Keep yourself in the proxy-server the connections-status.
    If your proxy-server runs on a normal PC, it should be enough to try to connect to the internet.
    But do you need control over multiple dial-up dialers etc., this probably isn't enough.
    If I can find the time, I'll look into it.
    Maybe direct access to the modem is also an option.
    That depends on the modem of course and then you probably also need additional scripting. I guess that's not what you're looking for, but if you need info on that, it's probably also an option to look at a wvdial-script on Linux for connection to the internet. It might also be a problem if you have multiple channels for connecting onto the internet (cable,phone,ASDL etc.)

  • Modem problems with dial-up connection

    Hello,
    I just bought a used G4 12 inch Powerbook a few days ago. I have been trying to get on the internet and checked all connections and gone through as much as I know of System Preferences and just can not get a dial tone, can not get the modem working. This is just for simple dial-up connection. I know the phone line is good because I am using it in another machine right now. Any suggestions?
    Thanks

    Thanks to all of you who have responded. At first I thought perhaps I needed a modem line as I was using a phone line, so I bought a modem line at Wal-Mart. Unfortunately it did not work either. My wife has a computer tech at work who specializes in MacIntosh and looked at it yesterday, he determined that I just have a bad modem. So, my next step is to take it into the local Apple Store, whenever I have time, perhaps by the start of winter. Eventually I will have a machine up and running again - eventually.

  • Dial-up connection freezes programs

    I am having a strange problem. :? When I am connected with my dial-up modem, some programs won't start (e.g. kuickshow) or will freeze when I try to open a dialog window such as open/save file (e.g. kedit, kdiff3, firefox).  If I am not connected or if I am connected with my network card, everything works fine. I think the problem started a few weeks ago when there was problems with firefox.
    I am using kppp, KDE  3.3.2, the ltmodem drivers and the stock kernel 2.6.10
    Any idea about what might be the problem?

    Well... Yesterday, I notice that if my network is running
    /etc/rc.d/network start
    ,  everything is fine.  However if I stop it,
    etc/rc.d/network stop
    I have the same problem when my dial-up connection is running.  :?  I think that it is a problem with my network setup in rc.conf.  A month ago or so, I changed my network setting from dhcp to static.  It might be related to my problem.  I still need to check that out.

  • E71x Dial-up connection for internet access on ph...

    When I lived in Africa I would use either google talk or skype to speak with my family back in the States. Wifi was extremely rare especially in my area so I had to connect via a dial-up connection. When I bought my E71x, I installed "Fring" on it (an amazing app) and I am able to call and speak to someone on google talk or skype over my phone. My question is, how do I setup a dialup access point for my cell phone so that I can access the internet and google talk/skype by that connection? Thanks, Joshua

    I don't use either Fring or Skype in my handset, I use a program called truphone from www.truphone.com and the network settings enable you to use it via 3G GPRS or WiFi.
    You should check with your network operator that this is permitted, as most see VoIP services as revenue loss and will disable the ports or charge extra for the service.
    Shunts...
    I will mostly be communicating with a Nokia E72 Zodium Black
    Nokia E72-1 with Vr 051.018.207.04 Software
    If this post helped... Add some kudos!!

  • 80 GB iPod and a dial-up connection

    Hello everyone,
    Can someone please tell me if it is possible to use the 80GB iPod with a dial-up connection? I know that it is a lot slower and I am worried that it may affect the downloading process of a movie or book. Thank you for taking the time to answer my question.
    Compaq   Windows XP  

    Hi saem,
    When you sync your iPod with iTunes, it actually doesn't relate to connections with the Internet.
    iTunes doesn't connect to the Internet to simply sync with your iPod (apart from going to the internet to check your if your iPod's firmware is the latest), so I don't see how you could have problems, in that respect.
    (I just proved this to myself - I disconnected from the Internet during an iPod sync, and it was all successful.)
    Now, if your computer have a full, slow hard drive, or lower RAM than normal, that's different (since those kinds of things don't exactly pertain to Internet connection, Dial-Up or not).
    Forgive me if I didn't read your question properly, or something.
    -Kylene

Maybe you are looking for

  • Site-to-site vpn with 2 asa and home router

    I am trying to establish a site-to-site vpn between 2 ASAs and am able to get the tunnel to establish and can get connectivity from the remote end of the connection to the local side. However, traffic from the local side is not able to get to the rem

  • IPC Between Two ADF Portlets on Same Page using Events Failure

    Considering that a full page submit is required for the passing of parameters to work properly, I am trying to use IPC Events to pass a parameter from one ADF Portlet to another. There are no good examples out there, but I am trying to use what is ou

  • Importing sales data

    I have a customer who is planning to use Oracle Financials as their finance solution, but we need to auto-feed the sale transactions from the sales system. These transactions corresponds (loosely speaking) to sales (or purchase) orders and delivery o

  • How to run netbeans swing code without netbeans

    hi i created a GUI use netbeans and it compiles and runs under netbeans. my question is how can i run it on a machine doesnt have netbeans. i realise that in the netbeans project scr file, there s two .java file, but have no idea how should run it. i

  • Problem in synchronization

    Hi, i intent synchronize but... appear an error: • Synchronization started  • Connection set up (without proxy) to: http://clariana:50200/sap/bc/MJC/mi_host?~sysid=J2E&  • Connection to server failed.  • Problems during synchronization: Not found 404