Hi I have silverlight client timeout problem tried the
TimeSpan getSessionMapTimout = new TimeSpan(0, 20, 0);
Client.Endpoint.Binding.CloseTimeout = getSessionMapTimout;
Client.Endpoint.Binding.ReceiveTimeout = getSessionMapTimout;
Client.Endpoint.Binding.SendTimeout = getSessionMapTimout;
Client.Endpoint.Binding.OpenTimeout = getSessionMapTimout;
Client.InnerChannel.OperationTimeout = getSessionMapTimout;
options including the InnerChannel.OperationTimeout , None of them work the silverlight client still timesout in 30 secs .
The interesting thing is the IE regestry settings "ReceiveTimeout"=dword:00007530 seem to override the Silverlight client settings, cause if i remove this from the registry, everything works fine.
How to make these timeout working from with in silverlight and override IE registry settings.
What kind of binding are you using? I'm using the Duplex binding for hours / days at a time and there's no issue.
Did you check the timeout on the server side? There's also the ASP.NET connection timeout to take into consideration (I think it's set to 30s or something by default).
I have found that, using the client stack outside of IE (in out-of-browser mode), requests that take longer than 10 seconds fail with an ArgumentNullException coming from HttpWebRequest.EndGetResponse(). From what I've seen on the web, other people have also experienced this in Firefox and Chrome, but in IE it seems to work fine (presumably it waits indefinitely and you can roll your own timeout).
I don't believe there's an API in the client stack for setting the timeout.
You need to use the Client Http stack in Silverlight if you need to extend the timeout. The standard browser stack that Silverlight uses has a timeout set by the browser and you can't manipulate it.
HttpWebRequest.RegisterPrefix("http://", WebRequestCreator.ClientHttp);
That will register all Http to be on the client stack. However, using this method has some limitation. This page has a great chart showing the difference between the two stacks.
Related
I have a service that is is self hosted in a WPF application. Also I have a WPF client and a xamarin android client that use the WCF client to consume the service.
I have realize that I can call with no problems from the WPF client, but from android client I only can call 2 times, later the application stop responding and after a time, I get a timeout exception.
I have read threads that say that I have to close the client proxy to solve the problem, because the number of connections are limited in the server, but this doesn't solve the problem. In fact, I have tried to no close the proxy in the WPF application and I don't have problems and I have tried to close the proxy in the android application, in the finally try/catch and in a using block, in both cases the application stops responding.
I try the solutions in threads like this and this, but they doesn't solve my problem.
The code is the following:
WPF client:
int _numeroLlamadas = 0;
GestorAplicacionesServiceProxy _proxy = new GestorAplicacionesServiceProxy();
private void BtnTest_Click(object sender, RoutedEventArgs e)
{
txtResultado.Text = _proxy.GetData(2);
_numeroLlamadas = _numeroLlamadas + 1;
txtNumeroLlamadas.Text = _numeroLlamadas.ToString();
}
In this case I have a counter to know how many times I can call to the service, and I don't have problems to call 20, 30, 40... times.
In the android application I have this code in the click event of a button:
using (GestorAplicacionesServiceProxy miProxy = new GestorAplicacionesServiceProxy(_binding, _endPointAddress))
{
string miResultado = miProxy.GetData(2);
Toast.MakeText(this, "Hola", ToastLength.Short).Show();
}
In this case I use a using block to dispose the proxy when I finish to use it. But I only can call 2 times and in the next call, the application throw a timeout exception.
The service, the instance context mode is per call.
How the WPF client works fine and the android application isn't, I was thinking that perhaps it is because the android application has different considerations.
Thanks.
I'm developing a signalr app having a silverlight client and my project structure is
A web app having the server (hub)
a wpf app having the wpf client (for the first client)
a web app for the other web (silverlight) clients
The problem I'm having is that when I try to send a message to other clients in one of the web clients using Firefox or IE, I need to wait around 2 seconds. But if I send another signal or 2 signals in the same time, It works fine. I can assure that my signals are sent on time only if I send 2 messages.
Could this be because of the transport or sthg that I need to configure? Clients are working fine with Chrome.
OK. Forcing the transport to Longpolling has solved my problem.
here is how I start the connection
IClientTransport transport = new LongPollingTransport();
await HubConnection.Start(transport);
You are correct, we have documented the issue on the release notes
Server sent events has known issues on Silverlight
Messages are delayed when using server sent events on silverlight. To force long polling use the following:
connection.Start(new LongPollingTransport());
I need to understand a complex web project and for that I need to be in a debugging session for much longer time. For this I have set the "Application Pool" "Ping Enabled" to False in the IIS 7.5, so that IIS does not terminate itself and I can continue debugging.
But, if I continue debugging for a longer time, I do not receive the response in the browser, rather I receive a blank page. Although there was no exception raised while debugging and everything went properly.
What other configuration is needed to remain in a debugging session for a longer time?
Can anyone suggest?
There are two timeouts that you must consider, both the server and the client.
You have already resolved the server timeout but the client (browser) gives up and shows a white page, usually after 1 minute.
You need to increase the timeout that the browser is willing to wait for.
There are steps to do this in IE here: http://support.microsoft.com/kb/813827
I have a duplex TCP connection between a Silverlight client and a WCF C# server. The server is constantly pushing updates up to the client. However after about ten minutes of user inactivity, any user operation that gets sent to the server results in an exception, although the updates continue successfully.
Given the period of time involved and the inactivity on the client side I'm guessing it involves the ReceiveTimeout setting. However when I attempt to set it on the client (see below), it doesn't fix this.
CustomBinding binding = new CustomBinding(new BinaryMessageEncodingBindingElement(),
new TcpTransportBindingElement());
binding.ReceiveTimeout = TimeSpan.MaxValue;
EndpointAddress address = new EndpointAddress(testAddress);
testClient = new TestClient(binding, address);
Do I need to set this on the server side as well as or instead of the client side?
If I do need to set this on the server, how would I do this, as I'm using OperationContext.Current.GetCallbackChannel<ITestClient>() to get the callback interface?
The callback interface doesn't give me access to properties to set timeouts and I'm not sure what to cast it to to enable this. I tried setting it on the ServiceHost on the server side but this also didn't appear to fix it.
I would configure an extended OpenTimeout, ReceiveTimeout, and SendTimeout on both the client and server.
I think you should set on both sides.
you may try to get the binding used on service side (through ServiceHost.Description)and set its ReceiveTimeout.
I don't understand why you don't use netTcpBinding directly and use the web.config or app.config?
Turns out the answer is: it doesn't matter. Setting it on the client side was technically correct, but according to Configuring Web Service Usage in Silverlight Clients:
Caution: This value of receiveTimeout is not being respected in
Silverlight 4 and setting it will not affect the behavior of the
application.
I have since tested this and verified it was the case.
The answer ended up being implementing a keep alive call to the server once every four minutes (four minutes chosen because it's half of the ten minute receive timeout, minus a buffer).
I was modifying a WCF service to increase the timeout for a Silverlight client. Before modifying the timeouts I'm seeing CommunicationObjectAborted exception (The HTTP request to [URL] was aborted). At first I only modified the web.coffig of the WCF and it had no effect. I then followed this post (http://blog.ecofic.com/?p=379) and edited ServiceReferences.ClientConfig as well. Now I'm seeing a No endpoint exception. The exception was not thrown immediately after the client connects to WCF, but after about 1 minute after it connected to WCF. I suspect it has something to do with the timeouts?
I set open, close, send and receive timeouts to 5 minutes in both config files.
Any idea? Thanks!
As Richard pointed out, sendTimeout only be needed to set on the client (your Windows Phone app in this case). Double check the ServiceReferences.clientConfig as manually added value might get overwritten by Visual Studio.
Also you can check this post for using Fiddler on Windows Phone (emulator).
You should use Fiddler to analyse the requests performed by your application. This way, you will be able to know what happen when the request is sent, where exactly it is sent (if it is sent), and the response code from the server.
Obtaining these informations is the first step on the way to troubleshoot your issue.