To give WebSync a real test, we purchased an Acer desktop with 3 cores and 3 Gig of RAM. We then hooked up two laptops (2 gig ram, dual core processors) to simulate the clients. When testing upper limits of client connections, we hit 30,000 clients simultaneuously connected with no problems and we pushed over 30,000 messages a second.
When we hit these upper limits, the problems we started having were related to the laptops not being able to process the responses, not due to the server failing to send them. This was done over a 100 Mbit connection.
Yes. All public methods are accessible in a completely thread-safe manner.
WebSync encodes all requests and responses in UTF-8.
For this, you will want to use a "Publisher", which will create and send a request to the WebSync server with about two or 3 lines of code. Check out our section in the documentation about publishers.
All you need to do is set up a handler for the "onSubscribersChanged" event. This is a simple function that will fire when a user enters or leaves a given channel, containing details about which users have entered or left.
Not really, but there is a caveat. If you're using a certain web browser (*cough* IE *cough*), and you're using cross-domain requests, you're going to be limited to the length of a GET request, since it uses JSONP. This limit is 2083 characters, which is significant, but worth noting. Since this limit only applies to publishes, you can easily bypass it by ensuring that your publishes occur on the same domain as your page.
Not at all, set up as many as you want. In fact, WebSync can actually be more efficient with more channels. They'll get created and torn down as needed, so be creative!
They can be whatever you want them to be. There is no restriction on how many or what names you use for your channels, so as long as you understand that messages are grouped by channel, you're good to go.
There are 2 ways to detect when users disconnect from the server:
Note that you can use the "autoDisconnect" property of the JavaScript client to make the disconnect event occur more "immediately" for web-based clients. If you set the disconnect property of the JavaScript to { sync: true }, the browser will make a syncronous XHR request to the server when it closes to disconnect the client. Note that for this to work properly, you must also set the disconnect url to be on the same domain as the page being closed.
Your private key should be used in your proxy. The request goes from the client to your web server, at which point you add in your private key to override the key sent from the client. The request is then forwarded to our WebSync On-Demand servers for processing.
Proxies are very simple to set up, and involve simply running a simple page on your server that can pre-process the request. Check out our section in the documentation about proxies for details.
This is almost always due to bad data being passed into JSON.Deserialize(). This method relies on Microsoft's DataContractJsonSerializer, which does not accept a null value as the target of deserialization. Ensure that you're not passing null as the value to deserialize.
This means that your client handler is not properly registered, or the path you've specified to the client handler was not found. Try browsing directly to the URL for your client.ashx file, and confirm that it's returning valid javascript. If it is, then confirm that the path you've specified in your web page matches the URL you browsed to.
This is almost always a question of finding the right path according to your web.config. First, confirm that the path to your client.ashx (or whatever you called it) is correct by looking at the "Handler Mappings" section of IIS. Then, confirm that you're browsing to the correct url, and your page is pointing to the right url in it's <script> tag. If those settings are correct, then you might want to confirm that IIS is configured to handle ".ashx" extensions.
If all of the above checks out, you might want to make sure that you've got the right configuration according to your version of IIS and the "Application Mode" of your app pool. For IIS 6 and IIS 7 classic mode, the "system.web/httpHandlers" section will be used, and for IIS 7 integrated mode, the "system.webServer/handlers" section will be used. In an attempt to cover both scenarios, all our examples include both sections, with the "validateIntegratedModeConfiguration" flag set to false to disable validation in IIS 7.
For each event in WebSync, there are 2 possible scenarios for how the event gets processed, specified as attributes on the method in the format Execution.[XYZ]. These 2 scenarios are:
WebSync uses Execution.Normal by default, which means that WebSync will wait for your method to finish before continuing with processing the request.
Short version: the "BeforeUnsubscribe" and "AfterUnsubscribe" events are guaranteed to fire for every WebSync client when they are no longer subscribed to a channel, regardless of whether they manually unsubscribed, manually disconnected, or killed their browser session.
Long version: the age old question of tracking when users leave your site is a good one. And you must remember that you can't just detect browser closing, because you have to handle someone killing the browser process, shutting down their computer, etc. The good news is, WebSync can handle all this for you.
First, you need to understand that WebSync automatically cleans up after itself. If, after a (configurable) period of time, a client fails to communicate with WebSync, WebSync will flag and disconnect the client. When this happens, WebSync will fire the "IdleDisconnect" event. This is distinct from the "Disconnect" event, which is fired when a user manually disconnects. (These two events are distinct from each other because "IdleDisconnect" events do not involve actual messages sent from the disconnecting client.)
Second, you need to know that clients are guaranteed to fire the "unsubscribe" events for all channels to which they were at some point subscribed. That means regardless of whether they call "unsubscribe" manually, disconnect via the "disconnect" method, or were disconnected due to inactivity, the "unsubscribe" events will always fire.
Given those two pieces of information, it follows that you can always know when a client is no longer available by simply hooking into one of the "unsubscribe" events, and tracking the "clientId" as needed.
For each event in WebSync, there are 2 possible scenarios for how the event gets processed, specified as attributes on the method in the format EventContinue.[XYZ]. These 2 scenarios are:
In the latest version of WebSync On-Demand, you have access to "meta" data. This information tells you when someone arrives or leaves a channel. You can set up a handler for this data when you subscribe to a channel. You can learn about it by looking in the documentation for the "subscribe" method found here, in particular the "onMetaReceive" function.