Shop OBEX P1 Docs P2 Docs Learn Events
spinneret as a client, GETting to a remote server — Parallax Forums

spinneret as a client, GETting to a remote server

max72max72 Posts: 1,155
edited 2011-12-22 16:49 in Accessories
I have used the multiport object and it works for the "get my IP" example. I'm trying to do the same to send data to a sql server using GET.
I found it worked a cvouple of times, the I started having problems and the server hangs waiting for the response (after the connection).
I tried to change port 2 and it worked for some time, so I guess there is a kind of port filtering or hangup.
I would like an opinion or a suggestion about this strange behaviour.

Thanks in advance,
Massimo

Comments

  • Mike GMike G Posts: 2,702
    edited 2011-12-20 18:14
    Check the DAT block block and make sure global caching is turned off.
    globalCache           byte    $0
    

    Make sure your out going request is using a different port than your server.

    Lastly, post your source code.
  • max72max72 Posts: 1,155
    edited 2011-12-21 00:08
    Thanks.
    Globalcache is set to 0.
    I'm sending the GET request to port 80 of the server.
    I tried to change the port2 number between 5000 and 8000 with strange results. Lastly I set it to 1024, and it worked all the night sending a get every 5 minutes without a hitch. I'll try again later to see if it is repeatable.
    While I'm happy it works I cannot understand why....

    Massimo
  • Mike GMike G Posts: 2,702
    edited 2011-12-21 05:19
    Most likely it is configuration. I can't help you unless you post your code.
  • Mike GMike G Posts: 2,702
    edited 2011-12-21 17:34
    max72, you are firing up all 4 posts as listeners when you really want one client. Start 3 ports as listeners and create one dedicated client for your outbound calls.
  • max72max72 Posts: 1,155
    edited 2011-12-21 23:39
    Thanks, I tried to do that but I had problems (I was still using the offending ports) so I switched back to the basic example to narrow the problem.
    Next step will be to have permanent a client (or maybe more..).
    The data is coming from a GSM module (as SMS) so the traffic is very small. Anyway I was able to successfully update more than 300 points at the moment.

    Massimo
  • T ChapT Chap Posts: 4,223
    edited 2011-12-22 12:10
    Mike G wrote: »
    max72, you are firing up all 4 posts as listeners when you really want one client. Start 3 ports as listeners and create one dedicated client for your outbound calls.

    I have been looking at examples and am not getting how you create a dedicated client. I assume that to create less than 4 listeners, just choose which of the 4 will be set to listen.
  • Mike GMike G Posts: 2,702
    edited 2011-12-22 16:49
    I have been looking at examples and am not getting how you create a dedicated client.

    Configure a socket with the remote server IP and port and leave it.
    I assume that to create less than 4 listeners, just choose which of the 4 will be set to listen.
    I setup the listeners when the HTTPServer initializes. It's just a repeat loop.
Sign In or Register to comment.