Passing win32 socket handle to .net application possible?

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
 
C

Chad Z. Hower aka Kudzu

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
 
M

mlc

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top