libdill icon indicating copy to clipboard operation
libdill copied to clipboard

Can add some api to export the fd ?

Open szyusong opened this issue 6 years ago • 2 comments

For example, add some api like dill_tcp_get_fd, by using it, it provides the possibility to do something like ioctl: ioctl(dill_tcp_get_fd(s), SIOCOUTQ, &pending);

szyusong avatar Apr 18 '19 01:04 szyusong

The problem is that libdill socket layer can (and does) do some buffering itself. Thus, when you extract the underlying socket it can be in an inconsistent state, without libdill-layer buffers being pushed into it. That way SIOCOUTQ becomes quite useless.

Possible solution: Don't use dill sockets. Use a POSIX socket instead and integrate it will libdill via fdin/fdout.

sustrik avatar Apr 18 '19 04:04 sustrik

If use a POSIX socket with the fdin/fdout, then I need to do the same thing as dill_tcp_connect, there are lots of work.

szyusong avatar Apr 18 '19 07:04 szyusong