# Debug binary data?

**URL:** <https://forum.xojo.com/t/debug-binary-data/41613>\
**Category:** Getting Started\
**Created:** [January 16, 2018, 3:25pm UTC](https://forum.xojo.com/t/debug-binary-data/41613 "2018-01-16T15:25:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mathias\_Maes1](https://forum.xojo.com/letter_avatar_proxy/v4/letter/m/4da419/32.png) [@Mathias\_Maes1](https://forum.xojo.com/u/Mathias_Maes1)\
**Post date:** [January 16, 2018, 3:25pm UTC](https://forum.xojo.com/t/debug-binary-data/41613/1 "2018-01-16T15:25:06Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [January 16, 2018, 3:58pm UTC](https://forum.xojo.com/t/debug-binary-data/41613/2 "2018-01-16T15:58:33Z")

</div>

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](http://documentation.xojo.com/index.php/EncodeHex)

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

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 7:04pm UTC](https://forum.xojo.com/t/debug-binary-data/41613/3 "2020-10-29T19:04:07Z")

</div>


