开发者

Problem with showing my packets in console with ACE

开发者_C百科

for Debug reasons i want to show my outgoing packets in Console. The packets arrive at the server correctly btw. But if i want them to show in Console before sending, then it is showing just nothing:

    ACE_Message_Block *m_Header;

    ...

    size_t send_len = m_Header->length(); // Size of the Message Block

    char* output = m_Header->rd_ptr();
    printf("Output: %s", output); // Trying to show it in Console
    // Send it
    server.send(m_Header->rd_ptr(), send_len);

Someone has an idea?


Likely the data you send contains 0's - and you'll need to append a newline as well.

for (size_t i = 0; i < send_len; ++i) {
  if (output[i]<32) {
    printf("\\x%02hhx", (unsigned char) output[i]);
  } else {
    printf("%c", output[i]);
  }
}
printf("\n");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜