Pass a socket descriptor to another process in Linux using Mono

I need to pass a socket descriptor to another process on Linux using Mono. On Windows, this is easily accomplished with Socket.DuplicateAndClose (int). I found this post describing the process in c:

Can I share the file descriptor with another process on Linux, or is it local to the process?

In my program, I was able to create Unix sockets between two Mono programs using the Mono.Unix and Mono.Unix.Native namespaces. I was able to find some details that are roughly similar here:

http://svn.aircrack-ng.org/trunk/lib/csharp/MonoExample/NDesk-dbus/

I still get an EINVAL error when I try to send a socket descriptor. Does anyone have a sample of this work?

+3


source to share





All Articles