I was trying to get it to work on windows, where it is implemented as a tcp socket. But the command handler in ssh coverts it to an estream_t file descriptor from libgpg-error where read/writes are done with posix calls, which doesn't work for win32 sockets.(compiled with mingw-gcc).
You get Bad File Descriptor in es_read and the handle gets closed immediately.