Passing win32 socket handle to .net application possible?

  • Thread starter Thread starter mlc
  • Start date Start date
M

mlc

I have a server (in win32 C++, TCP) that listens and accepts socket calls,
then via CreateProcess and handle inheritence over the command line starts
up a process to handle the client request. Is there any way I can write a C#
application that can also handle the client request from a open handle from
a win32 process in a like manner? (No, I can't rewrite the server in C#, or
change it in any fundmental way, I can however replace the request handling
program and a small amount of the server code)

Is this possible and how to do it?

Thanks,

Mark
 
mlc said:
I have a server (in win32 C++, TCP) that listens and accepts socket
calls, then via CreateProcess and handle inheritence over the command
line starts up a process to handle the client request. Is there any way
I can write a C# application that can also handle the client request
from a open handle from a win32 process in a like manner? (No, I can't
rewrite the server in C#, or change it in any fundmental way, I can
however replace the request handling program and a small amount of the
server code)

You can make the calls directly to Winsock yourself. While you dont state it
the inherited handle is a socket handle I assume?

Or are you wanting to somehow pass that handle to the System.Net.Classes?


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"


ELKNews - Get your free copy at http://www.atozedsoftware.com
 
It is a socket handle. I would idealy like to goto to System.Net rather than
make unmanged code calls. However the passing part is what has stopped me.
 
Back
Top