2 ms·
It's possible, you'd need to override the relevant system calls with LD_PRELOADed library. I don't know if a complete drop-in solution is the right solution th
by jsnell 11y ago
It's possible, you'd need to override the relevant system calls with LD_PRELOADed library.
I don't know if a complete drop-in solution is the right solution though. If your application is performance sensitive enough to require embedding a full networking stack, you might as well make use of better APIs. For example it'd be silly to indirect the event dispatching through something poll/select-like. Instead you'd much rather just have the core IO loop call the handlers directly. Or as another example, zero-copy will be impossible with a recv()-like interface where the client provides the buffer that data needs to go to, but will be trivial with an API where it's the network stack giving the client a buffer that already has the data.
If you want to experiment with this, mTCP (http://shader.kaist.edu/mtcp/ http://shader.kaist.edu/mtcp/) is probably the right starting point.
- blibble 11y agothis is exactly how openonload works, it's pretty impressive that they get nearly all weird behaviour of the Linux socket API correct (correct behaviour across fork, select/poll/epoll, multicast behaviour, etc). presentation: http://www.openonload.org/openonload-google-talk.pdf http://www.openonload.org/openonload-google-talk.pdf