How to check connection services when using webservices? - windows-phone-7

In my app I'm using webservices and if internet connection is true, my app runs very good.
Without internet my application generates an error. So how can I check internet connection before my application is connected to services. Because I cannot work with applications tuogn although I did
try {}
catch {}
So, my app is errors in servicesReferent. How do I do if the case does not have an internet connection, or faulty services?

You can use GetIsNetworkAvailable in the NetworkInterface class from the System.Net.NetworkInformation namespace
for example
bool isNetworkAvaiable = NetworkInterface.GetIsNetworkAvailable()

Be aware that if you connect a WP7 to your development workstation using the USB cable, it will use your workstation's internet connection and this is almost certainly why you always see the network as being available when you are debugging. Disconnecting your workstation from the local network won't help because from the phone's perspective it's still connected to a network (containing two hosts, itself and your workstation) even when that network doesn't have a gateway to anything else.

Related

mDNS (avahi) services not found anymore after connecting to a different network

I'm running a avahi deamon on my linux server to publish a service at my local network.
For testing purpuse I use dns-sd.exe from bonjour for discovering. After connecting to the LAN service discovery is working well. But if I close the connection, connect to a different network (e.g. hostspot of my iphone) und reconnect to LAN service discovery is not working anymore.
I have to restart windows to solve this issue.
I have also noticed this behavior with other (self implemented) clients (with the use of DNSAPI.dll, mono-zeroconf).
It looks like windows is reconfiguring something in the background.
Does somebody has any idea?

Azure Blob Service: Weird TLS 1.2 issue -- Looking for suggestions to investigate it

So, I've encountered a weird situation and am wondering whether you may have some suggestions as to how to investigate it...
I have a C# app that connects to Azure Blob Services using the latest SDK and TLS 1.2. When I am at home and on the Internet, I am able to upload files to blob storage without any issues. However, when I go into our office, using the same app on an office computer, I get a connection failure. I am able to access the Internet through a browser.
The networking is as simple as at my home... ISP connection, router/firewall, my computer.
I cannot imagine why enabling TLS1.2 would suddenly make my app not work in the office, but still work at home. Based on these tests, it seems like a NIC issue or an infrastructure issue at the office, but I have never heard of a NIC or router blocking TLS 1.2 outside of a VPN connection. There is no VPN involved.
I am planning on directly connecting my computer to the company's Internet connection, configuring the nic for the wan, and see what happens. If it works, then there must be something strange going on with the company's router (nothing elaborate; netgear, or such).
Has anyone encountered this issue? Seems really odd to me...
Thanks for your time and interest,
Mike
• It is not an issue with enabling of TLS 1.2 on your office network or your home network or even your Azure blob storage, it is basically related to the communication over SMB TCP port 445 from your local system to the mapped Azure blob storage on your system.
On your home network, you were able to access the blob storage and able to upload files in it because your ISP has enabled outbound communication over SMB TCP port 445 on his firewall and gateway server over the internet and thus, you were able to access the mapped Azure blob storage and upload files in it. But the same case is not valid for in your office network as it being a protected one, outbound communication over SMB TCP port 445 is restricted and not allowed.
• To test whether communication over TCP SMB port 445 can happen or not, I would request you to execute the below powershell command and check the results thereafter: -
Test-NetConnection -Port 445 -ComputerName somestoragexxx.file.core.windows.net
If this TCP 445 connectivity fails, then you could check with your ISP or your on-premises office network security is blocking communication over outbound port 445. Please note that you should open the outbound port instead of inbound port 445.
Kindly refer to the documentation link below for details to know the different ways to access files in Azure files: -
https://learn.microsoft.com/en-us/azure/storage/files/storage-files-faq#general
Also, refer to the link below for knowing the Azure routing mechanism to reach the resources hosted on Azure: -
https://learn.microsoft.com/en-us/azure/virtual-network/virtual-networks-udr-overview#default

Prevent to access internet by specific program if it is not connected to OpenVPN servef

I've looked over the Internet and haven't found any solution. My task is to prevent access to the Internet by Google Chrome if the system is not running an OpenVPN connection. So, as the result it will:
Block Internet access if OpenVPN is not connected.
Allow Internet access if OpenVPN is connected.
Any ideas? The platform is Windows 10. With other types of VPN connections, it was possible to stick to the specific interface and to configure Windows Firewall. The target machine is remote one and is manipulated by TeamViewer so the best case is to block only Google Chrome.
I've found a workaround. You need to switch your main network to Private profile. When you connect through OpenVPN your system works in Public profile. Thus you can configure the firewall to allow connections only through the Public profile. I this case, when Google Chrome runs through Private profile it will not allow the connection.

Issue with VPN to enable CI system and accessing MACs for Visual studio developement

I am trying to setup build servers, and a mac available for remote builds in VS. As results I have a Synology server setup with VPN enabled. The Firewall and all settings are setup according to the synology guide. I have then enabled port forwarding on my linksys WRT1900ACS router, for the three ports needed (500,1701,4500), which is also enabled in the firewall on the router. I then access the VPN locally without any issues, tried with different guides (guide1 guide2 guide3).
I then create copies of the vpn connection and inserting my static IP from my ISP. I logon to a tethered internet from my phone, as to ensure the network is different. I then get an error:
local l2tp connection attempt failed because the security layer encountered a processing error during initial negotiations.
Searching it seems like it is an error with the registry (reg 1 reg 2). Changing that just makes the vpn connection hang. What am I doing wrong? After waiting a long period of time (several minutes), the same error returns.
I have also tested on an Ipad using the settings defined in ios-settings.
For others the above guides solves the issue if you have a static IP. You however have to ensure that your ISP, have allowed the traffic, and that your router does not receive a double IP registration, rendering your static IP invalid.
which was the case for me.

Google Cast App without internet

is it also possible to run Cast apps on Chromecast without internet access in a local network only?
Maybe with an own webserver.
For a showcase event I can not ensure access to the internet.
The use case is for demonstration only.
Thanks you.
As of early February 2015 the Chromecast requires an internet connection to stream even local content (i.e. from your computer over your wifi).
The reason is that, to facilitate the media playback, special code (Javascript) is run directly from Google servers. Why can't Google just download this code directly to the Chromecast one time? I believe it has to do with security amongst other reasons (some nice and some not so nice)
The evidence? My internet goes down all the time, interrupting whatever I'm casting.
As Leon says, the 'cast needs Internet access part of the time. Booting (I didn't know that!), and to resolve the AppID to the receiver app URL. Once the 'cast has the URL to load and had resolved the hostname in the URL to an IP address, it no longer requires the Internet, IF everything is set up correctly and on the local subnet.
For example, I develop cast apps at home. Lets say I registered my app and the custom receiver associated with it is at https://10.0.0.5/basil_app1/reciever.html (or at a hostname that resolves in public DNS to the private IP 10.0.0.5, a hostname is what I actually use).
Then, if my app needs to load further media, it can reference it either by the already resolved hostname, or by IP, again served from the host at 10.0.0.5
It sounds a little like you're unclear on how to set up and interact with a private network and web server, which is not a Chromecast problem really.
For me, if I had to do a Chromecast demo at (for example) a customer site and was unsure of the network situation, I'd set up the Chromecast to use a private hotspot Wifi network provided by my cell phone, and have all the web resources needed served from my laptop, again configured on the private Wifi network. Again, not really a 'cast programming problem.
I have the following setup to cast from my PC to the chromecast using a mobile wireless connection.
ChromeCast -> Local Router -> PC with PDANet -> USB connect to Mobile Phone with FoxFi app installed.
Basically I have the PC and ChromeCast connected to a new wifi router ($25 belkin from Walmart). Initially, Chromecast yells at you because there isn't an internet connection. To kill the complaining from ChromeCast, simply install FoxFi on your mobile and PDANet on your PC. I've connected them via USB since the hotspot feature wont work with my carrier.
Once the connection has been established, you should see 2 connections on your PC and you can cast from PC to Chromecast. Watching netflix on it right now. Haven't tested from another device yet.
So....
Install:
-FoxFi on Samsung Galaxy S4
-PDANet on PC/Laptop
Connect:
- Samsung Galaxy S4 -> PC (via USB in my case)
- PC -> Local router
- Chromecast -> Local router
On your PC you should see 2 connections. The PDANet connection with internet access and the Local router with no internet access.
Also note that I initially installed the chromecast on my primary wifi that has internet access. No issues there, but just in case you try to get this method to work and it doesn't, maybe try setting it up on a router with inet access first, then switch to the non-inet router.
Chromecast requires an internet connection when it boots up and to load the receiver apps. Your media content can come from a local web server once the receiver app is loaded.

Resources