I’m using Sockets in my Silverlight application to stream data from a server to a client.
However, I’m not quite sure how timeouts are handled in a Silverlight Socket.
In the documentation, I cannot see anything like ReceiveTimeout for Silverlight.
- Are user-defined timeouts possible? How can I set them? How can I get notifications when a send / receive operation times out?
- Are there default timeouts? How big are they?
- If there are no timeouts: what’s the easiest method to implement these timeouts manually?
Since I couldn’t find any nice solution, I solved the problem manually by creating a
System.Threading.Timerwith code similar to the following:This handles also cases where a timeout occurs which is produced by simple lag, and lets the callback return immediately if the operation took too much time.