Serial Protocol Analyzer on Ruby
summary
Builds a Ruby serial protocol analyzer that reads exactly what the sender writes to the device, tests on macOS and Windows COM ports, and finds that simply catting the device fails because file descriptors are per process. Tries send_io on Unix domain sockets, FFI C extension and /proc tricks, and various kernel hacks for two weeks with no reliable result. Settles on IO.pipe + fork to share descriptors between sender and analyzer, which works and yields a simple, publishable Ruby solution.
AI-written summary · about
chapters (7)
- 0:00Introduction and background
- 4:09Why build the analyzer
- 10:28Windows environment setup
- 13:59File descriptor sharing challenge
- 19:58Solution with IO pipes
- 24:18Summary and future plans
- 26:08Q&A session
related talks
30mBuilding a binary protocol client in Ruby: A magical journey!
44mOutside the Web Box: Using Ruby for Other Protocols
36mWorking with binary data in Ruby
56mPacket -Fu with Ruby
26mConcurrency in Ruby: From fork() to Fiber
31mPeeking into Ruby: Tracing Running Code
26mTCP Sockets Programming in Ruby
30mRuby Systems Programming
