Drop XML over binary framing
Torey Heinz
committed Feb 22, 2026
commit 9676656518319bf70160448e31607e884abdb1ea
Showing 1
changed file with
0 additions
and 35 deletions
slides/03-real-world.html
+0
-35
| @@ | @@ -237,7 +237,6 @@ end |
| <p>Communicate directly with <strong>Verisign's EPP</strong> (Extensible Provisioning Protocol) to register <code>.com</code> and <code>.net</code> domains.</p> | |
| <ul> | |
| <li class="fragment"><strong>Persistent TCP/TLS connections</strong> to Verisign's servers</li> | |
| - | <li class="fragment"><strong>XML over binary framing</strong> — 4-byte length header + XML payload (RFC 5734)</li> |
| <li class="fragment"><strong>Connection pooling</strong> — maintain authenticated sessions, reuse efficiently</li> | |
| <li class="fragment"><strong>Automatic recovery</strong> — reconnect without manual intervention</li> | |
| </ul> | |
| @@ | @@ -279,40 +278,6 @@ end |
| </aside> | |
| </section> | |
| - | <section> |
| - | <h2>Binary Pattern Matching</h2> |
| - | <p class="muted small">Something you <strong>can't easily do</strong> in most languages</p> |
| - | |
| - | <pre><code class="language-elixir" data-trim> |
| - | # Sending: 4-byte length header (big-endian) + XML payload |
| - | def send_frame(socket_info, xml_data) do |
| - | xml_bytes = :unicode.characters_to_binary(xml_data, :unicode, :utf8) |
| - | total_length = byte_size(xml_bytes) + 4 |
| - | frame = <<total_length::32-big, xml_bytes::binary>> |
| - | |
| - | send_data(socket_info, frame) |
| - | end |
| - | |
| - | # Receiving: parse the 4-byte header, then read that many bytes |
| - | def receive_frame(socket_info, timeout) do |
| - | with {:ok, <<length::32-big>>} <- recv_data(socket_info, 4, timeout) do |
| - | data_length = length - 4 |
| - | recv_data(socket_info, data_length, timeout) |
| - | end |
| - | end |
| - | </code></pre> |
| - | |
| - | <div class="callout fragment"> |
| - | <p><code><<total_length::32-big>></code> — "4 bytes, big-endian integer."<br/> |
| - | In JS/Ruby, you'd manually slice buffers and call <code>readUInt32BE</code>.<br/> |
| - | In Elixir, it's just <strong>pattern matching</strong>.</p> |
| - | </div> |
| - | |
| - | <aside class="notes"> |
| - | This is one of my favorite Elixir features. Binary pattern matching. That double-angle-bracket syntax creates and matches binary data at the bit level. To send: build a 4-byte big-endian length header followed by XML. To receive: pattern match on exactly 4 bytes, extract the length as a big-endian integer, then read that many bytes. In JavaScript or Ruby, you'd be manually slicing buffers. Here, it's just pattern matching. |
| - | </aside> |
| - | </section> |
| - | |
| <section> | |
| <h2>Connection Pool</h2> | |
| <p class="muted small">Long-lived TCP sessions managed as supervised processes</p> | |