client constantly reconnecting - signalr

My .net application which connects to signalr hub is constantly reconnecting.
This problem only occurs on certain other corporate networks which makes me believe something is being blocked.
I've tried to use the jabbr.net website from the same network and this doesn't work either (in chrome).
How can i trace/fix this issue?

I think you're experiencing this issue https://github.com/SignalR/SignalR/pull/1553. We're working on a fix for it. The issue happens when the server sent events request times out but the actual http requests is still going. What then happens is that the longpolling transport and server sent events http requests fight for the connection.
To workaround this you can specify the LongPollingTransport specifically. We'll look at fixing this for the next release.

For your server, in your web.config's system.diagnostics section add:
<sharedListeners>
<add name="SignalR"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="signalr.log.txt" />
</sharedListeners>
For your client (I'm assuming .net C#), its logging is via Debug.Writes. Also, I'd recommend hooking into the Error handler for your connection.
If your using a JS client you can turn logging on via
// Non dynamically made connection
connection.logging = true;
// Dynamically made connection
$.connection.hub.logging = true
Hope this helps!

Related

The remote name could not be resolved: 'maps.googleapis.com'

I have an asp.net web application that uses Google Maps. Everything has been running fine for quite some time. All of a sudden yesterday, no calls to Google API would process. I assume we reached a query limit but upon checking, all quota totals were 0. I then realized we were not including our API Key in the requests. I added the appropriate API key and the maps came back online. However, I still cannot GeoCode a address using the following:
maps.googleapis.com/maps/api/geocode/xml?address=(PROPERTY-ADDRESS)&key=(OUR-KEY)
returns:
The remote name could not be resolved: 'maps.googleapis.com'
We get the same error when trying to use:
maps.googleapis.com/maps/api/distancematrix/xml?origins=(LOCATION1)&destinations=(LOCATION2)&units=imperial&key=(OUR-KEY)
However all calls to:
maps.googleapis.com/maps/api/js?key=(OUR-KEY)
work fine.
This code has worked fine for a long time, with no modifications.
We are on a dedicated server, using the same IP, However the site does run through Incapsula (Not sure if that makes a difference)
I already added:
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true">
</defaultProxy>
</system.net>
but this did not help.
The error: The remote name could not be resolved makes it seem like a DNS issue, but the server is online and can resolve maps.googleapis.com/maps/api/js without any problem.

Azure Dedicated Cache Role not working in the cloud

I'm sorry there's not a lot to go on with this, but some pointers in the right direction would be greatly appreciated.
I have an Azure Cloud Service with a web role and a dedicated cache worker role. In the web role, I'm using the cache like so in a Web Api controller:
var cacheFactory = new DataCacheFactory();
_cache = cacheFactory.GetDefaultCache();
And in the web.config:
<dataCacheClients>
<dataCacheClient name="default">
<autoDiscover isEnabled="true" identifier="MyProject.Workers.MyCache" />
</dataCacheClient>
It works fine locally using the Azure emulators, but on deploying to Azure, the controller method times out (after about 15 minutes!). The only error message I have is:
ErrorCode:SubStatus:There is a temporary failure. Please retry later. (One or more specified cache servers are unavailable, which could be caused by busy network or servers. For on-premises cache clusters, also verify the following conditions. Ensure that security permission has been granted for this client account, and check that the AppFabric Caching Service is allowed through the firewall on all cache hosts. Also the MaxBufferSize on the server must be greater than or equal to the serialized object size sent from the client.). Additional Information : The client was trying to communicate with the server: net.tcp://MyProject.Workers.MyCache:24233.
EDIT:
Similar lack of success trying to use the web role itself for caching:
<dataCacheClient name="default">
<autoDiscover isEnabled="true" identifier="MyProject.WebRole" />
<localCache isEnabled="true" sync="NotificationBased" objectCount="100000" ttlValue="300" />
<clientNotification pollInterval="60" />
</dataCacheClient>
Simply nothing coming back from the server. It doesn't even time out!

In asp.net, Web Service endpoint is incorrect when client connects to production server

I've been scouring the net for almost two days and must be missing something (possibly basic).
On the test (local) web server I have set up a simple service, and using a client, I discover the service and run it without problems.
Using the same client, I discover the same service, but on the production server using https://MyNewStuff.com/WebServices/MyService.asmx (the real internet address of the service) without problems, but when I try to run it it fails with an EndPointNotFound exception. Upon investigating I find that the client's app.config is incorrect as follows;
<endpoint address="https://ProductionWeb.Ourdomain.com/WebServices/MyService.asmx"
binding="basicHttpBinding" bindingConfiguration="MyServiceSoap"
contract="MOX24.MyServiceSoap" name="MyServiceSoap" />
i.e., not set up correctly as it reflects https://ProductionWeb.Ourdomain.com ... and not https://MyNewStuff.com/WebServices, indicating that the service (discovery) is sending the wrong information to the clients (it is sending the server's name and domain and not the 'web' name).
Any help on this would be greatly appreciated!!
If your client is a web application, put https://MyNewStuff.com/WebServices/MyService.asmx in the Web.Release.config.

Error when call google map static api in asp.net web application:The remote name could not be resolved:'maps.googleapis.com'

I used google map static api to get map image, but I got an error "The remote name could not be resolved:'maps.googleapis.com'" when executing using (HttpWebResponse response = request.GetResponse() as HttpWebResponse).
But I can got image of google map in windows application(same code with web application), I don't know what happened
This thing is happen due to proxy setting in your system.Please add this code in your web.config file and it will work.
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true">
</defaultProxy>
</system.net>
The problem can go from invalid url (hostname) to your firewall or proxy blocking the request or even misconfigured host file or DNS.
I also faced same issue.
If you are connected with local area network and protected by Proxy server then Go in google chrome settings.
Our system takes default settings from google chrome.
In settings of chrome, go in proxy settings.Click on Lan setting.Click on proxy setting checkbox and click as well on by pass proxy server for local addresses.Also fill details of your proxy server in textbox.
Go in advance and in exceptions field type localhost.Run project again.It will work.

Access Session in WCF service from WebHttpBinding

I'm using WCF service (via WebGet attribute).
I'm trying to access Session from WCF service, but HttpContext.Current is null
I added AspNetCompatibilityRequirements and edited web.config but I still cannot access session.
Is it possible to use WebGet and Session together?
Thank you!
Yes, it is possible. If you edit the web.config:
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>
and add the AspNetCompatiblityRequirements, the HttpContext.Current should be available.
Check everything once again, maybe you've put the attribute in the wrong place (the interface instead of the class?).
A RESTfull service with a session?
See excellent discussion here: Can you help me understand this? "Common REST Mistakes: Sessions are irrelevant"
http://javadialog.blogspot.co.uk/2009/06/common-rest-mistakes.html (point 6)
and
http://www.peej.co.uk/articles/no-sessions.html
Quote from Paul Prescod:
Sessions are irrelevant.
There should be no need for a client to "login" or "start a connection." HTTP authentication is done
automatically on every message. Client applications are consumers of
resources, not services. Therefore there is nothing to log in to!
Let's say that you are booking a flight on a REST web service. You
don't create a new "session" connection to the service. Rather you ask
the "itinerary creator object" to create you a new itinerary. You can
start filling in the blanks but then get some totally different
component elsewhere on the web to fill in some other blanks. There is
no session so there is no problem of migrating session state between
clients. There is also no issue of "session affinity" in the server
(though there are still load balancing issues to continue).

Resources