5 ms·
I suspect the n-by-k array part is a typo, an one-dimensional array of closures is all you need. I also don't think the closure approach is bad for code reuse.
by gizmo 17y ago
I suspect the n-by-k array part is a typo, an one-dimensional array of closures is all you need. I also don't think the closure approach is bad for code reuse. The closures serve just to bind the environment to the TCP-handler and UDP-handler functions. The closures themselves are probably trivial and not worth sharing, and the protocol handler functions (or closures) can be shared like any other library function.
- pvg 17y agoWhere are you (and the OP) getting TCP and UDP from?
- danparsonson 17y agoMy point was that the protocols could in theory be used across connections other than serial ports.
- deleted 17y ago[deleted]