Android Question Websockets Basics

Discussion in 'Android Questions' started by lip, Jul 10, 2015.

  1. lip

    lip Active Member Licensed 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 or must we upgrade to 2012/IIS8?

  2. sorex

    sorex Expert Licensed User

    to anser the last question...

    you can use IIS &, 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
  3. lip

    lip Active Member Licensed User

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

    sorex Expert Licensed 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.
  5. imbault

    imbault Well-Known Member Licensed 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)
    DonManfred likes this.
  6. lip

    lip Active Member Licensed 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.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice