×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Jun 2003
    Posts
    75

    Sever response to many clients

    How to let a client (J2ME) send a request to server (Servlet) then the server (Servlet) send the response to all the clients (J2ME) or another client (J2ME) ???

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Location
    USA, FL
    Posts
    148
    By MIDP 1.0 specification a server can not connect to the client. Cliet has to make a request and then server should send a response. That is it.
    I don't know, if it is possible to do in MIDP 2.0...

    Dima
    GameArtists.com

  3. #3
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395
    A server can never connect to a client under any circumstances... this is really the definition of "server" and "client" (or at least, in a TCP/IP context).

    If the phone can act as a server (that is, if it supports ServerSocket connections) then you should be able to do something... but not if the phone only supports HTTP or regular (client-side) sockets. In those cases, you're stuck with polling the server at intervals to see if there's new data.

    Graham.

  4. #4
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Rotterdam, Holland
    Posts
    118
    You can do what you wish to do by putting the incoming request on a queue on the server and have all clients poll that server for new requests every X seconds. Do note that latency will be huge, but then, it's huge anyway with GPRS. This is the only way to implement 1-to-many requests using HTTP, which is a pull request protocol. There are tricks to keep connections open and such, but well, you'll have to figure those out yourselves, considering we're in the business of providing a multi-user/network SDK for mobile devices . Either way, latency is in the 2-5 second range at best, regardless of what you do if you use HTTP.

    Remon van Vliet
    Ex Machina
    remon@exmachina.nl

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×