Debug binary data?

Hello

I have a socket that acts as a Websocket server. So far so good, clients are connecting etc. Now I want to debug the binary data that the client is sender.
So, I want some logging in the DataAvailable event. BUT: The logging doesn’t work when I’m trying to display the binary data.

So, this works:

Sub DataAvailable() Handles DataAvailable Dim buffer As String buffer = Me.ReadAll system.debuglog("received some binary data!") End Sub

This won’t work:

Sub DataAvailable() Handles DataAvailable Dim buffer As String buffer = Me.ReadAll system.debuglog("received this binary data: " + buffer) End Sub

The last piece of code doesn’t produce any log at all. How can I display the buffer?

Right now I’m thinking of Wireshark to display network packets, but it seems odd that I cannot just display incoming info.

Thanks for any guidance!

If the data is outside the printable range you will have problems seeing it, you can either breakpoint on the debuglog line and inspect the contents of buffer in the IDE or you could try:

http://documentation.xojo.com/index.php/EncodeHex

system.debuglog("received this binary data: " + EncodeHex(buffer))