Feature #1644


recv on inherited socket wrapped in TCPSocket does not read data, on Windows

Added by kntuaf (Kedar H) over 13 years ago. Updated about 2 years ago.

Target version:


On Windows, if you try to wrap an existing winsock socket that was inherited from a parent process into a TCPSocket, any calls to recv on this socket in the child process will not retrieve any data.

This is because the inherited socket is not a member of the internal "socklist" structure in win32.c. rb_w32_select filters out all sockets that are not in this internal list, prior to calling ws2_32!select.

One good solution is for TCPSocket.for_fd to make sure to insert its argument into the socklist structure so that subsequent Winsock functions wrapped by Ruby will work as though the socket were created by this Ruby process. Another possible solution is to expose another method, something like TCPSocket.from_new_fd.

Actions #1

Updated by shyouhei (Shyouhei Urabe) over 13 years ago

  • Status changed from Open to Assigned
  • Assignee set to usa (Usaku NAKAMURA)
Actions #2

Updated by usa (Usaku NAKAMURA) over 13 years ago

Inheritance of fd/handles is not supported now on Windows.
Of cource, it's our task for the future.

Actions #3

Updated by usa (Usaku NAKAMURA) over 13 years ago

  • Priority changed from Normal to 3
Actions #4

Updated by znz (Kazuhiro NISHIYAMA) almost 13 years ago

  • Category set to ext
  • Target version set to 2.0.0
Actions #5

Updated by usa (Usaku NAKAMURA) over 10 years ago

  • Description updated (diff)
  • Target version changed from 2.0.0 to 3.0

Updated by mame (Yusuke Endoh) over 5 years ago

Usa-san, do you still have a plan to imprement this?

Updated by usa (Usaku NAKAMURA) over 5 years ago

  • Assignee changed from usa (Usaku NAKAMURA) to windows
Actions #8

Updated by naruse (Yui NARUSE) about 2 years ago

  • Target version deleted (3.0)

Also available in: Atom PDF