XML Socket - Header conundrum...

Ask a Question related to Macromedia Flash, Design and Development.

  1. #1

    Default XML Socket - Header conundrum...

    I'm desperately trying to found out how to add a header to my socket
    message sends. I'm communicating via flash to a c++ server, and of
    course all the flash sent messages end in a null.

    HOWEVER, this is an industrial, processor intensive bit of software,
    and scanning every char that comes into the C++ server for a null is
    really inefficient. Much better if I could include a 2 byte header
    announcing the messages length from flash. I cannot find anyway to do
    this and its driving me crazy, including invading my dreams!

    I tried converting the message length to two ascii character
    equivalents and appending them to the front of the XML message before
    sending it, but of course found that if the message length is less
    than 256 characters, well the first byte of the message length will be
    a zero - which reads as a null character, so ending the message before
    it starts!

    Does anyone have any idea how I could solve this sticky issue (if its
    even possible)? Any pointers or advice will be incredibly appreciated,
    and I'd be in debt to your goodself :)

    jog
    jog Guest

  2. Similar Questions and Discussions

    1. Module naming conundrum
      Greetings, all. I have three modules I am preparing for submission to CPAN, but I freely confess that I can't come up with decent names for them. ...
    2. update conundrum
      Hey, I have a slight issue on my hands and don't know how to approach it. Here's my situation: I have a form which allows the user to update...
    3. Socket.accept problem via Socket.for_fd($stdin.fileno)
      Hi, I am experiencing a rather infuriating problem with Socket.accept on Windows XP. The problem exists when I try to create a Socket from...
    4. color conundrum
      Is there any speedy way to replace either black or white in an image with another color? "Replace color" only gives shades of gray as options, and...
    5. keyboard conundrum
      Alan Coopersmith <alanc@alum.calberkeley.org> wrote in message news:<bd5tvj$2omc$3@agate.berkeley.edu>... If not using XKB, the offset is So in...
  3. #2

    Default Re: XML Socket - Header conundrum...

    write out the two bye length encoded as a four character hex string .. eg if
    length is 255, write out 00FF (say)

    --
    All the best,
    Jeckyl


    Jeckyl Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139