Can anybody offer me some help understanding websockets?
I have an application working reasonably well with HTTP using long polling but would like to see if I can improve speed and reliability with Websockets. I have downloaded WebSocketExample and think I have my head around sending messages to the server but not so sure about getting them back:
- Presumably events are named and raised by the remote server - ie wsh_ServerTime will fire on my device when the Server raises an event called "ServerTime"?
- I define "Sub wsh_ServerTime(l as List) in the Activity in which I have Dim wsh as WebSocketHandler?
When sending messages, does the Server need to know the structure of my message of is the Map as defined in the example ("messsage",myMsg) a standard format?
Finally - to try and get my Server developer going (he is as confused as me so far) we have SBS Server 2011 running IIS7. Can he do anything with this using asp.net or must we upgrade to 2012/IIS8?
Right, IIS is not the best option for websockets, pretty complicated to configure, do able on IIS7, with custom config. But the best is using B4J and it's embedded Jetty servlet server among other functionalities (ready to deploy with only one jar file)
It seems i'm out of my depth on the server side. I'll do a bit more reading before I embarrass myself any further. Meanwhile I have solved my problem by having a second server for the long-polling in my app. I now have one server for my syncing SQLite databases between tablets (by looking for changes every 30 seconds then HTTP Posts of JSON records) while my instant push-commands are handled by long polling to a second server. My original problem was that the IIS server blocked other HTTP requests while the LongPoll was waiting.