Communicating with a unmanged c++ TCP connection
-
I have to write a client that gets its data through a TCP connection from a server written in unmanaged C++ (It does support managed c++ though). It sends a large structure. The Structure is unmanaged. It even has unmanaged structures in the structure. My client must be C#. I have two chooses (as I see it); 1) Modify the server to package the data into an managed type. The server does support c++ managed code. Making it easy on the client. 2) Or Parse the binary incoming TCP message, then place it into a managed structure on client. I'm leaning toward option 1. Since I think it will allow more versatility, however the programmers that wrote the original server think the parsing is a simple method. I hope someone can help me Decide. Thanks Glenn
Programmer Glenn Earl Graham Austin, TX
-
I have to write a client that gets its data through a TCP connection from a server written in unmanaged C++ (It does support managed c++ though). It sends a large structure. The Structure is unmanaged. It even has unmanaged structures in the structure. My client must be C#. I have two chooses (as I see it); 1) Modify the server to package the data into an managed type. The server does support c++ managed code. Making it easy on the client. 2) Or Parse the binary incoming TCP message, then place it into a managed structure on client. I'm leaning toward option 1. Since I think it will allow more versatility, however the programmers that wrote the original server think the parsing is a simple method. I hope someone can help me Decide. Thanks Glenn
Programmer Glenn Earl Graham Austin, TX
Would it make sense to add a layer between the unmanaged c++ and the C# that is a managed c++ app that would translate to a seralized type? Changing the server to serve managed data only serves to force all clients to be managed code. If you have the freedom to add a second port on the server that provides the go between interface, then your server/client interfaces could look like the following: Server Port x binary structure comm Port y managed structure comm Managed client connects to port y Unmanaged client connects to port x The application on port y could be a small stub that locally connects and translates the data to/from port x.