It&#x27;s possible, you&#x27;d need to override the relevant system calls with LD_PRELOADed library.<p>I don&#x27;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&#x27;d be silly to indirect the event dispatching through something poll&#x2F;select-like. Instead you&#x27;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&#x27;s the network stack giving the client a buffer that already has the data.<p>If you want to experiment with this, mTCP (<a href="http:&#x2F;&#x2F;shader.kaist.edu&#x2F;mtcp&#x2F;" rel="nofollow">http:&#x2F;&#x2F;shader.kaist.edu&#x2F;mtcp&#x2F;</a>) is probably the right starting point.