Android Question Websockets Basics

lip

Active Member
Licensed User
Longtime User
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?

Thanks
 

sorex

Expert
Licensed User
Longtime User
to anser the last question...

you can use IIS & asp.net, classic asp or php

or even better

use xampp and have the benefit to have apache, php, mysql at once without all the misery to get php working on IIS
 
Upvote 0

lip

Active Member
Licensed User
Longtime User
to anser the last question...

you can use IIS & asp.net, classic asp or php

or even better

use xampp and have the benefit to have apache, php, mysql at once without all the misery to get php working on IIS

Everything on line suggests we need IIS8 or above. Are you saying IIS7 CAN handle Websockets?
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
IIS is the webserver part from windows, but who says you need to use it for sockets?

you can use sockets via apache or a self written application instead.
 
Upvote 0

imbault

Well-Known Member
Licensed User
Longtime User
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)
 
Upvote 0

lip

Active Member
Licensed User
Longtime User
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.
 
Upvote 0
Top