Connected or not?

Anyone knows how can I know if I'm connecet to internet or not?
Thanks!

You can use the following to check if you are online and that a specific URL is reachable.
import java.net.*;
import java.io.*;
public class URLChecker
     public static boolean checkURL(String s)
          boolean reachable = true;
          try
               URL url = new URL(s);
               URLConnection conn = url.openConnection();
               conn.setRequestProperty("User-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)");
               BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
               rd.close();
          catch (IOException ioex)
               reachable = false;
          return reachable;
}

Similar Messages

  • ITunes 10.0.1 "the network connection could not be made"

    This was not a problem for me on 10.0. I can no longer update my podcasts because I get this error message
    "There was a problem downloading (podcast name) the network connection could not be made"
    so first I ran diagnostics for the network connection and it said that it could not make a secure connection to the itunes store. I clicked help and it said to add a rule to the windows firewall (even though one already existed), I did that and now its green but I still get the same error message. Here is the information from the diagnostics.
    Microsoft Windows 7 x64 Ultimate Edition (Build 7600)
    iTunes 10.0.1.22
    QuickTime 7.6.8
    FairPlay 1.9.16
    Apple Application Support 1.3.2
    iPod Updater Library 10.0d2
    CD Driver 2.2.0.1
    CD Driver DLL 2.1.1.1
    Apple Mobile Device 3.2.0.47
    Apple Mobile Device Driver 1.49.0.0
    Bonjour 2.0.3.0 (214.3)
    Gracenote SDK 1.7.1.420
    Gracenote MusicID 1.7.1.78
    Gracenote Submit 1.7.1.106
    iTunes Serial Number 0637C6B672852BC1
    Current user is not an administrator.
    The current local date and time is 2010-09-28 09:37:04.
    iTunes is not running in safe mode.
    WebKit accelerated compositing is enabled.
    HDCP is supported.
    Video Display Information
    NVIDIA, NVIDIA GeForce GTX 260M
    ** External Plug-ins Information **
    No external plug-ins installed.
    iPodService 10.0.1.22 is currently running.
    iTunesHelper is currently not running.
    Apple Mobile Device service 3.2.0.0 is currently running.
    ** Network Connectivity Tests **
    Network Adapter Information
    Adapter Name: {A05144D0-DC62-4367-9AEA-8537EF0D39C9}
    Description: Intel(R) 82577LC Gigabit Network Connection
    IP Address: none of your business
    Subnet Mask: 255.255.255.0
    Default Gateway: none of your business
    DHCP Enabled: Yes
    DHCP Server: none of your business
    Lease Obtained: Tue Sep 28 09:02:30 2010
    Lease Expires: Thu Sep 30 09:02:30 2010
    DNS Servers: none of your business
    Adapter Name: {E8E377A7-4E43-4F3C-9BE3-9218319096C5}
    Description: VirtualBox Host-Only Ethernet Adapter
    IP Address: none of your business
    Subnet Mask: 255.255.255.0
    Default Gateway: 0.0.0.0
    DHCP Enabled: No
    DHCP Server:
    Lease Obtained: Thu Jan 01 09:00:00 1970
    Lease Expires: Thu Jan 01 09:00:00 1970
    DNS Servers:
    Active Connection: LAN Connection
    Connected: Yes
    Online: Yes
    Using Modem: No
    Using LAN: Yes
    Using Proxy: No
    SSL 3.0 Support: Enabled
    TLS 1.0 Support: Enabled
    Firewall Information
    Windows Firewall is on.
    iTunes is NOT enabled in Windows Firewall.
    Connection attempt to Apple web site was successful.
    Connection attempt to browsing iTunes Store was successful.
    Connection attempt to purchasing from iTunes Store was successful.
    Connection attempt to iPhone activation server was successful.
    Connection attempt to firmware update server was successful.
    Last successful store access was 2010-09-28 09:34:16.
    I modified it slightly because my IP address is not necessary for troubleshooting this issue. is anyone else having the same problem? how can i fix this

    Did you get anywhere with this? I'm getting the same error when I try to use Home Sharing. It worked through all the 9.x versions, but with 10.0.1, I can't even home share between two identical MacBooks. I get the above error when I try to copy a song / video / etc. from one library to another.

  • TS2830 Sync for IPod Touch quit working and I get error messages "a session could not be started" and "a connection could not be established" although the IPod appears in ITunes.

    This is a new problem for an IPod Touch  I have had for a year.  The IPod is hooked up by cable and appears in ITunes. I can examine all the content on the IPOD  and I can click "sync".  It goes through to Step 7 and then the error messages occur.  First "a session could not be started with the IPod" and when that dialogue box is closed, the message "a connection could not be established to the IPod." 

    Maybe:
    Sync Session Failed to Start iTouch iOS5: Apple Support Communities
    iphone could not be synced sync session failed to start...: Apple Support Communities

  • On 3G we cannot send emails from either our iPhones or iPad and this also happens with some WiFi connections but not all.  Yet we can always send emails from our Hotmail Email account.  What is causing this and what do we need to do to resolve it?

    On 3G we cannot send  Business emails from either our iPhones or Ipad and this also happens with some WiFi connections but not all.  Yet we can always send emails from our Hotmail Account using both 3G and WiFi.
    We bought the iPhones and Ipad so that we could send emails while we are out of the Office, but we are not able to do this unless we can find a WiFi connection. Incoming emails are fine.  We use IMAP, for Business emails just incase this is relevant and I know that Hotmail is POP3.
    Our technical IT knowledge is not great, so we look forward to your suggestions as to how to resolve this. 

    Contact whomever supports the email account and get the correct Outgoing email server settings from them.

  • Error message: "FireWire connections are not supported.  To transfer songs"

    I recently purchased a Monster iCarPlay to play my ipod in my car. I have had no problems until recently. Upon disconnecting my ipod from the iCarPlay wire, I the following message popped up: "FireWire connections are not supported. To transfer songs, connect the USB cable provided." It also prompts me to click the center button to dismiss the message. However, I'vd followed these instructions, and the message does not go away. Does anyone know what I can do to resolve this problem? Or is it anything to worry about?

    That is the message you see when you attach a 5th gen iPod to a computer using FIREWIRE. so... i suspect that for some reason, the 3rd party iCarPlay device must be confusing the iPod into thinking it is being docked or attached to a data line of some type and not simply charging.
    As for the sudden occurrence of the message, it does seem strange however, keep in mind that you are using a 3rd party device that may not be supported or endorsed by Apple at all.
    Beavis2084

  • My usb that i have been using on my computer for a while suddenly stopped working, but is still glowing and letting me know that it is connected, but not showing up in disk utility

    my usb that i have been using on my computer for a while suddenly stopped working, but is still glowing and letting me know that it is connected, but not showing up in disk utility

    Either the physical drive or the enclosure electronics has failed. The light you are seeing is powered by the USB connection, the power, electricity, all USB ports put out. That doesn't mean the actual physical hard drive or the USB to SATA bus electronics are working properly. If it doesn't show in Disk Utility then it is DEAD.
    Most of the time it is the enclosures electronics that fail. Removing the physical drive from the enclosure and put it in another enclosure or using a SATA to USB adapter, one that has it's own AC power supply, might allow you to get the files off the drive.

  • User gets "This network connection does not exist" when she tries to log on to Terminal Server (2008 R2)

    User gets "This network connection does not exist" when she tryes to log on to Terminal Server (2008 R2)
    I got more than 100 users. Shes the only one getting is. We tried four computers (All Windows 7 Pro)
    Nothing useful in event viewer to mention.

    Hi,
    Thank you for posting in Windows Server Forum.
    Does that user able to login previously?
    From your comment, it seems that there is some permission issue with that user. As you have checked that user with different system also. Please check that user is added under “Remote Desktop User” local group and also allowed “Allow log on through
    Remote Desktop service” permission under group policy. Also please check that when user tries to login it uses “Domainname\Username” format.
    In addition for a try, also check by disabling firewall on one particular system.
    To add users and groups to the Remote Desktop Users group by using Local Users and Groups snap-in:
    1.  Click Start > Administrative Tools, Open Computer Management.
    2.  In the console tree, click the Local Users and Groups node.
    3.  In the details pane, double-click the Groups folder.
    4.  Double-click Remote Desktop Users, and then click
    Add.
    5.  In the Select Users dialog box, click Locations to specify the search location.
    6.  Click Object Types to specify the types of objects you want to search for.
    7.  Type the name you want to add in the Enter the object names to select (examples) box. 
    8.  Click Check Names.
    When the name is located, click OK.
    More information:
    Remote Desktop disconnected or can’t connect to remote computer or to Remote Desktop server (Terminal Server) that is running Windows Server 2008 R2
    http://support.microsoft.com/kb/2477176/en-us
    Hope it helps!
    Thanks,
    Dharmesh

  • Bug (?) with Corporate Connectivity is (not) Working check

    Noticed something odd.  In situations where:
    Direct Access client is offsite
    their Internet access is via WiFi
    they first have to enter their access credentials through a web-based captive portal before access is granted
    then the Corporate Connectivity Check process malfunctions.  Have seen cases where, after accessing the captive portal and being authenticated, Internet access works on the client.  Direct Access then connects successfully.  This is confirmed
    on the server console, showing the client connected and the user credentials used.  The client is able to access internal resources just fine (e.g. network drives on file servers).
    But on the client itself, it still says Corporate Connectivity is Not Working.  The WiFi icon is showing an exclamation mark.  My belief is that this is caused by the client's inability to access Microsoft NCSI servers in a timely fashion.
    So it looks like the corporate connectivity checks are dependent on Microsoft NCSI checks.
    Can someone at Microsoft please look into this, as it is confusing our users (not to mention us guys in IT who have only just discovered this odd behaviour!).

    Hi Steven !
    Thanks a lot for your guidance !
    After I followed the steps, I found that the time out occurs when trying to resolve the internal domain name.
    The Windows Firewall was enabled on all profiles ( active on the public )
    There were no IPsec sessions established in the Security associations tab, so I enabled the audit policy of the IPsec as per your instructions.
    There is reoccurring error in the Security log :
    Date:          10/8/2014 10:08:49 AM
    Event ID:      4653
    Task Category: IPsec Main Mode
    Level:         Information
    Keywords:      Audit Failure
    User:          N/A
    Computer:      MyW8Client
    Description:
    An IPsec main mode negotiation failed.
    Local Endpoint:
     Local Principal Name: -
     Network Address: MyW8Client_Ipv6 address
     Keying Module Port: 500
    Remote Endpoint:
     Principal Name:  -
     Network Address: MY_DA_Servert Ipv6 address
     Keying Module Port: 500
    Additional Information:
     Keying Module Name: AuthIP
     Authentication Method: Unknown authentication
     Role:   Initiator
     Impersonation State: Not enabled
     Main Mode Filter ID: 180987
    Failure Information:
     Failure Point:  Local computer
     Failure Reason:  Negotiation timed out
     State:   Sent first (SA) payload
     Initiator Cookie:  9e636863e513b367
     Responder Cookie: 0000000000000000
    As far as I understand - the connection can not be established due to certificate error, which in my case is strange since my DA configuration is set to not use computer certificates, only Kerberos.
    I will keep digging but any additional tip/advice will be appreciated!
    Thanks again, Steven!
    P.S. Just noticed that the Event ID 4653 produce two types of "Failure Reason" - apart from "Negotiation timed out" I also get "No policy configured"

  • TS3297 My 2nd generation ipod touch is giving me the following error when I try accessing Itunes or the app store. "Cannot connect to the Store. A secure connection could not be established. Please check your date & time settings"  I am on a secure networ

    My 2nd generation ipod touch is giving me the following error when I try accessing Itunes or the app store. "Cannot connect to the Store. A secure connection could not be established. Please check your date & time settings"  I am on a secure networkl.

    Can't connect to the iTunes Store
    Make sure that time zone is correct in addition to date and time

  • HT2480 whenever i connect my iphone to pc while syncing mail in itunes a pop up" the connection is not available.outlook must be online or connected  to complete this action" please suggest me to solve this or bisable.

    whenever i connect my iphone to pc while syncing mail in itunes a pop up" the connection is not available.outlook must be online or connected  to complete this action" please suggest me to solve this or bisable.

    Cached exchange mode was already marked so that was not the issue.
    I have done all the usual of creating a new profile, reinstalling Outlook etc but nothing seemed to work. I also tried going back to Outlook 2007 and reinstalling Windows but same problem.
    However, I am not sure if it is connected but I was useing the option in MS Live Sync to synchronise Office settings which I turned off recently and now no longer have the issue. Unfortunately I cannot remember when in the process I did this so cannot be
    sure it was responsible - anyone else found this?

  • Error msgs in app store; network connection could not be made

    Anyone else having trouble downloading apps directly from the appstore on your iPhone or iPad?
    50% of the apps do not want to download. The msg I will get is that there was a problem and it will be available for download next time I connect to iTunes. And I already paid for it
    Connecting to iTunes on my iMac tonight there were updates available for apps, I clicked to download them and again about 50% of the apps will not download. I now get the error msg that that app blah blah blah could not be downloaded because a network connection could not be made. Even iBooks won't download. Others download fine.
    The apps I purschased on my iPad or iPhone and that did not download are nowhere to be seen.
    Any insight?
    cheers,
    Christine

    Just thought I would add that I did every test the help files suggest, no firewall etc.
    Strange thing is that after the majority downloaded I had about 55 apps left that could not be updated because of the network connection that could not be made, I downloaded them manually instead of clicking 'yes please do download them all'.
    I still came across a few that gave me the msg that an connection could not be made but when I skipped them and came back later to try again it did download. Took some time but I now have them all up to date.
    Now see if I can sync the iPhone and iPad.
    I run the latest iTunes 10.4.1 (10) and 10.6.8, have not updated to Lion yet.
    cheers,
    Christine

  • Create a public synonym for a db link - "Connection desccriptor not found".

    I want to create a public synonym for a db link.
    The existing db link name is tst.world ( which is in db links table and is working fine).
    I created the following db link using the following command:
    create public synonym "syn.world" for "tst.world";
    It created the synonym successfully.
    If I try the following, it throws error "Connection desccriptor not found".
    select * from [email protected];
    It says "Connection desccriptor not found".
    Any suggestions.
    Thanks in Advance.

    Well then, lookup the Documentation on the CREATE SYNONYM statement in the SQL Language Reference manual.
    The documentation lists the types of objects which you can create synonyms for.
    You can create synonyms for objects referenced across DBLinks.
    You cannot create synonyms for DBLinks.
    Hemant K Chitale

  • Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of '

    When I deploy the cube which is sitting on my PC (local) the following 4 errors come up:
    Error 1 The datasource , 'AdventureWorksDW', contains an ImpersonationMode that that is not supported for processing operations.  0 0 
    Error 2 Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of 'Adventure Works DW', Name of 'AdventureWorksDW'.  0 0 
    Error 3 Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of 'Customer', Name of 'Customer' was being processed.  0 0 
    Error 4 Errors in the OLAP storage engine: An error occurred while the 'Customer Alternate Key' attribute of the 'Customer' dimension from the 'Analysis Services Tutorial' database was being processed.  0 0 

    Sorry hit the wrong button there. That is not entire solution and setting it to default would work when using a single box and not in a distributed application solution. If you are creating the analysis database manually or using the wizard then you can
    set the impersonation to your heart content as long as the right permission has been set on the analysis server.
    In my case I was using MS Project Server 2010 to create the database in the OLAP configuration section. The situation is that the underlying build script has been configured to use the default setting which is the SQL Service account and this account does
    not have permission in Project Server I believe.
    Changing the account to match the Project service account allowed for a successful build \ creation of the database. My verdict is that this is a bug in Project Server because it needs to include the option to choose impersonation when creating the Database
    this way it will not use the default which led to my error in the first place. I do not think there is a one fix for all in relations to this problem it is an environment by environment issue and should be resolved as such. But the idea around fixing it is
    if you are using the SQL Analysis server service account as the account creating the database and cubes then default or service account is fine. If you are using a custom account then set that custom account in the impersonation details after you have granted
    it SQL analysis administrator role. You can remove that role after the DB is created and harden it by creating a role with administrative permissions.
    Hope this helps.

  • Podcast Error Message "The network connection could not be made."

    For the past few days, the same 4 of my twenty or so podcasts have had an exclamation point next to them. When clicked, the subject message appears "The network connection could not be made.". I figured these may have been canceled since other podcasts I subscribe to downloaded without a problem. But now, when I go into the iTunes store and try to subscribe to new podcasts, they won't download. I do not get an error message. The download begins and abruptly ends before any data is received. I can subscribe but well, a lot of good that does when nothing comes. Any ideas would be a HUGE help. Oh & yes, my network connection is fine. At least I think it's fine. Everything else internet related is just dandy. Thanks!

    I think there may be a networking problem with the specific podcast(s). I have a couple of these myself. It normally indicates I am not playing them on my iPod but sometimes (as now) there is an abnormal situation.
    I know that some Internet links have not been working perfectly in the last week or so (and the Apple forums have also been slow perhaps due in part to this), but it might be an idea to track the source down, starting with the iTunes shop and resubscribe.
    One I just checked has changed the feed and both are on the iTunes shop, so the first is showing the ! while the second works fine. The same is true for the second feed: although I am subscribed, a check of the originating website shows that the "File is not available."
    te

  • TS1398 I have I-phone 4S - Since updating to IOS 6, when at home with Wi-Fi network with my I Phone connection is not responding sometimes – for example if I want to check my G-mail it shows loading but nothing happens and after few minutes it displays "C

    I have I-phone 4S - Since updating to IOS 6, when at home with Wi-Fi network with my I Phone connection is not responding sometimes – for example if I want to check my G-mail it shows loading but nothing happens and after few minutes it displays “Cannot Get Mail” – The mail server “imap.gmail.com is not responding, Verify that you have entered the correct account info in mail settings
    Other times the Wi-Fi connection works fine and it check e-mail or other within few seconds. The connection problems seems to be intermitted
    This issue never happened before with IOS 5 since I bought the new phone in Oct 2011.

    We suffered the imap.gmail.com server problem After an IoS 6 upgrade. The simple solution is to delete the problem account, shut down the iPad, start up again and reenter the account. Everything comes back normally. Good Luck everyone!

  • Exception occured assuming connection is not valid

    Hi
    I am getting following error while executing a stored procedure.
    Exception occured assuming connection is not valid. This Connection has either timed out or been closed, and it has returned to its pool. You must re-acquire the Connection.
    Unable to close connection: This Connection has either timed out or been closed, and it has returned to its pool. You must re-acquire the Connection.
    Error is not frequent but it comes 1 outof 100 cases
    Can anyone give me a clue why this happens and how to sort out
    regards,
    Kamlesh

    Anywhere in your code that calls Connecton.close(). He means (I believe) that your code may have a condition that causes it to call close() before it's done with the connection.
    How are you acquiring the connection? Is it acquired and released in the same block of code or do you store it somewhere assumming it will be there when you need it?

Maybe you are looking for

  • Can't open PDF files in iTunes U

    I am having ALOT of trouble using iTunes U, I have downloaded a course and the PDF files within it but once I go to open the PDF file it's blank. It won't open in iBooks or kindle or a PDF viewer app. How do I open and view the PDF file???

  • Synchronize WF LOCAL tables error

    hi, I am getting the following error while running Synchronize WF LOCAL tables ORA-12801: error signaled in parallel query server P002 ORA-01400: cannot insert NULL into ("APPLSYS"."WF_LOCAL_ROLES_STAGE"."DISPLAY_NAME") i did not insert any null valu

  • How to check if my function is MT-safe?

    I wrote some functions in a multi-thread program. I can check if a function is MT-safe by man it. But I'm not sure, if a function calls only MT-safe functions means this function is MT-safe too? Any help is appreciated. Jenny

  • How to diplay username who login in a another page with php

    anyone please help me with whole codeing..m very new

  • Authentication ACS LDAP PEAP ?

    Hello Could you tell me if its possible to do 802.1X authentication with LDAP server using PEAP MS-CHAP v2 (Machine autentication) ? in fact, with Windows external database, its work fine. We use only machine authentication with vlan assignement over