iOS Question Socket messages

Discussion in 'iOS Questions' started by techknight, Apr 15, 2015.

  1. techknight

    techknight Well-Known Member Licensed User

    I noticed with TCP/IP Socket connections, that every once in awhile that the packet never makes it. and I got to send it 2 or 3 times before it finally gets there. I am using a socket connection with Astreams.

    Is there a way to test the socket to see if the packet made it? and if not, resend?
  2. Erel

    Erel Administrator Staff Member Licensed User

    TCP packets should not be lost. The rapid debugger wouldn't have worked if packets were lost.

    The connection should break if a packet is lost. Maybe there is a problem somewhere else.
  3. techknight

    techknight Well-Known Member Licensed User

    Yea I dont know.

    What I am doing is connecting directly to a Digi xBee style WiFi adapter at a specific port. It creates a serial link which works ok. But... Every once in awhile if I am sending packets say every 100 to 200ms, it sorta jitters, its never consistent. Most of the time it works, but every once in awhile, things "hang" and the packets never reach the device for a few seconds, then it picks back up again, sometimes getting them out of order. Acting like UDP strangely enough. It does the same things with android as well.

    Then, In one instance in my program I have a disconnect subroutine. it sends a packet to the destination socket, and then closes astream, and closes the socket. 95% of the time the packet never makes it before the socket closes. I need to know if there is a way to "test" if a packet got there?

    And sometimes when I first open the socket and its successful, I send a packet to the device that logs into the device, and the device replies back. Every once in awhile the login packet never makes it, because I never get a response back. I have to hit the button again, and then it works.

    Its very possible its the Digi WiFi adapter, but I dont know, no way to tell?
  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