Shop OBEX P1 Docs P2 Docs Learn Events
GET timeout with the multisocket server — Parallax Forums

GET timeout with the multisocket server

max72max72 Posts: 1,155
edited 2012-03-10 07:00 in Accessories
I'm using the spinneret to retrieve informations via GET from a remote server.
I can connect reliably and retrieve informations, but the remote server is quite slow, and it takes some seconds to have the answer back.
I cannot understand if there is a timeout and if it is possible to increase it a little bit in case I'm border line.

Thanks in advance,
Massimo

Comments

  • Mike GMike G Posts: 2,702
    edited 2012-03-10 06:35
    It's up to the program logic to read the response stream and determine if a timeout occurred.
  • max72max72 Posts: 1,155
    edited 2012-03-10 06:45
    OK. So the spinneret simply waits?
    Thanks again,
    Massimo
  • Mike GMike G Posts: 2,702
    edited 2012-03-10 06:58
    I'm assuming the Spinneret is making the GET request.

    Spinneret sends a socket request to the remote server.
    The remote server responds and the socket status is updated on the Spinneret. Let's assume success.
    The Spinneret sends the GET request.
    The remote server processes the GET and sends a response.
    The logic running in the Spinneret loops, waiting for the response. This is where you put the timeout logic.

    If you are using the HttpServer and associated code, there are examples on how to do this. If the existing loop exits too quickly or not quickly enough, then update the loop logic.
  • max72max72 Posts: 1,155
    edited 2012-03-10 07:00
    Perfect.
    Thanks for your time in explaining it to me.

    Massimo
Sign In or Register to comment.