eio icon indicating copy to clipboard operation
eio copied to clipboard

Support for socket options

Open anmonteiro opened this issue 1 year ago • 1 comments

Right now both Eio.Net.{connect,accept} return a socket, but I didn't find a way to e.g. set TCP_NODELAY on the stream socket. Did I miss an API?

anmonteiro avatar Sep 23 '22 17:09 anmonteiro

Looks like it's missing, indeed.

I was using it originally with the HTTP benchmark, but now that sends everything in a single packet it doesn't make any difference there.

As a work-around, you can of course get the FD directly:

Unix.setsockopt (Eio_unix.FD.peek_opt ssock |> Option.get) Unix.TCP_NODELAY true;

talex5 avatar Sep 24 '22 11:09 talex5