Announcement

Collapse
No announcement yet.

TCP SEND/RECV Question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • TCP SEND/RECV Question

    I have a need to send binary/hex data via TCP. The messages are also variable in length (think of robotics as opposed to HTML or file transfers). The attempts I've made seem to indicate that some Hex codes in the data may cause certain behaviors in the TCP RECV and/or TCP SEND commands, i.e., I create a "string" of hex codes but my messages sent and received do not appear to go beyond the first "00" byte in the data string.

    Are there any PB examples which might use this type of send/receive?

    Thanks

  • #2
    Dont' use ASCIIZ strings with binary data.
    Don't use TCP PRINT with binary data.
    Test the length of the data received, not the characters received.

    Comment


    • #3
      http://www.powerbasic.com/support/pb...ad.php?t=41648

      Comment


      • #4
        Thanks for the tip, I'm using the SEND and not the PRINT. I'm also not using null terminated strings ASCIZ or ASCIIZ.

        I eventually found my problem where I wasn't parsing the bytes correctly and was trying to use MID$ instead of ASC.

        Thanks again,

        Comment

        Working...
        X