We're implementing a brand new IP stack and we're now working on an efficient, more or less core guidelines compliant C++11/14 implementation.
GoF State pattern - a good idea in practice?
- Is the polymorphism a performance issue?
- In practice you have 11 states, and 10 events in the RFC, making 110 possible combinations. The state pattern seems to be a nice way to partition that space nicely
- RFC terminology vs. POSIX socket.h terminology - what do you chose?
- For example the RFC talks about
call OPEN, as different functions depending on state. It seems like POSIX uses
bind() as a way to do "passive open" and
connect as a way to express "active open".
- What's a good way to implement the terms "Socket" and "Connection" in C++?
- In POSIX you're used to having sockets as just file descriptors. In IncludeOS I don't think that makes any sense. The intuitive idea is to have a "socket class" but the RFC talks about a socket as just a pair of IP and port.
- Is a "connection" something that holds a pair of sockets? Is the RFC's TCB something we could just embed inside a "connection"
Any comments, tips and clarifications are welcome!