×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    May 2012
    Location
    Hyderabad,AP,India.
    Posts
    62

    Http Request sent twice from nokia devices....

    Hi,

    Im using HttpConnection for connecting to my server. My application is an E-Commerce application. Sometimes, single transaction is happening twice within a period of 2 sec interval and sometimes 40-50 sec interval. I tried

    1)making the button disabled immediately before the request is initiated, to prevent from multiple clicks from user
    2)initiated a flag before the request and updating the status immediately after the button click and sending the request.

    But, these are of no use...as the issue is still pending...plz help me resolve the problem asap.....
    Regards,
    Harsha

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: Http Request sent twice from nokia devices....

    This happens because if the device does not get back the result/Response of the HTTP request in short duration of time - the device implementation re-tries the request automatically.
    Its not because that the user is clicking the link twice, Its because the server is taking time to respond back.
    Minor change on the server side, it should respond to the request quickly by send an acknowledgement or just writing back the response code as 200 and then continue to send the rest of the data after it is processed. This will stop the device from sending the request again.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  3. #3
    Registered User
    Join Date
    May 2012
    Location
    Hyderabad,AP,India.
    Posts
    62

    Re: Http Request sent twice from nokia devices....

    Hi im2amit ,

    Thanks a lot for the reply. great piece of information. This would help me a lot.
    My question to you sir, is :
    What if there are so many users requesting the same server method and all the requests queuing up at server side and failing to respond (even the acknowledgement) back in time.....
    What would you suggest for this type of typical problems as seen from mobile user perspective..
    Regards,
    Harsha

  4. #4
    Regular Contributor
    Join Date
    Dec 2012
    Location
    India
    Posts
    265

    Re: Http Request sent twice from nokia devices....

    Hi Harsha

    In LWUIT IO package, there is are two classes called Network Manager and Connection Request.It is a convenience class that abstracts the process of networking so that we need not worry about lot of minor details.Although internally I guess they would have probably used HttpConnection only, I would recommend you to give it a try.

    Two functions,in Connection Request class, may help you in this particular situtation.They are

    setSilentRetryCount()
    setTimeout()

    More info here : http://lwuit.blogspot.in/2010/08/bas...-lwuit4io.html

    Let me know if it helps.

  5. #5
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: Http Request sent twice from nokia devices....

    Quote Originally Posted by harsha921 View Post
    Hi im2amit ,

    Thanks a lot for the reply. great piece of information. This would help me a lot.
    My question to you sir, is :
    What if there are so many users requesting the same server method and all the requests queuing up at server side and failing to respond (even the acknowledgement) back in time.....
    What would you suggest for this type of typical problems as seen from mobile user perspective..
    Many other people have faced such issues working with S40, here is solution - http://stackoverflow.com/questions/1...t-after-30-sec
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  6. #6
    Regular Contributor
    Join Date
    Dec 2012
    Location
    India
    Posts
    265

    Re: Http Request sent twice from nokia devices....

    Quote Originally Posted by im2amit View Post
    Many other people have faced such issues working with S40, here is solution - http://stackoverflow.com/questions/1...t-after-30-sec
    @im2amit
    The solution posted there doesnt work it seems.
    @harsha
    I am not sure, but try reducing the time limit (25 sec) imposed in the solution for time out.It may help

  7. #7
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: Http Request sent twice from nokia devices....

    If the server is not able to respond back in 25Sec, then setting up of time limit of 25 second - as the other solution will also not help.
    Best way is to respond from the server, say just response code within 25 sec - even if it can be done by a load balancer.... after which the device can wait for more time (without sending a 2nd request on its own) for the actual data to come.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

Similar Threads

  1. HTTP POST request on Nokia N9
    By meandnano in forum Nokia N9
    Replies: 1
    Last Post: 2011-09-28, 16:44
  2. Nokia 30 GPRS modem and sending http request
    By vindstation in forum Mobile Java General
    Replies: 7
    Last Post: 2006-10-24, 08:40
  3. HTTP request to Internet server with Nokia 30 GPRS modem?
    By vindstation in forum General Messaging
    Replies: 1
    Last Post: 2006-10-19, 07:43
  4. Nokia 3510i http request problem
    By icrni in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2004-11-18, 14:29

Posting Permissions

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