c# and c++ socket communication

  • Thread starter Thread starter Yu
  • Start date Start date
Y

Yu

Hi dear all,

I am building an application in C#, while guys from other
department is building the application in C++. We want to send message
to each other program through Socket. Do you think it is possible?

I used to develop both server and client in Java. but i am not sure
two different languages can communicate via socket?

thanks all!


Vincent
 
   I am building an application in C#, while guys from other
department is building the application in C++. We want to send message
to each other program through Socket. Do you think it is possible?

   I used to develop both server and client in Java. but i am not sure
two different languages can communicate via socket?

Sockets are OS networking primitives, and, as such, are language-
independent. You send bytes from one end, and receive bytes on the
other end - pretty much any language can handle that one way or
another. Of course, the interpretation of those bytes are up to you.

Now, if you need to do something more complicated that just streaming
something over, you might want to consider using a higher-level
framework, and not sockets directly. Examples would be DCOM (supported
out of the box in .NET and Win32 C++, so probably easiest), CORBA
(though I'm not aware of any up-to-date .NET provider), or ICE (http://
www.zeroc.com/). ICE in particular is very nice - powerful,
lightweight, and easy to use - but unfortunately, it's either GPL for
free (which may not be a problem for an internal app), or a commercial
version for some serious $$$.
 
Sockets are OS networking primitives, and, as such, are language-
independent. You send bytes from one end, and receive bytes on the
other end - pretty much any language can handle that one way or
another. Of course, the interpretation of those bytes are up to you.

Now, if you need to do something more complicated that just streaming
something over, you might want to consider using a higher-level
framework, and not sockets directly. Examples would be DCOM (supported
out of the box in .NET and Win32 C++, so probably easiest), CORBA
(though I'm not aware of any up-to-date .NET provider), or ICE (http://www.zeroc.com/). ICE in particular is very nice - powerful,
lightweight, and easy to use - but unfortunately, it's either GPL for
free (which may not be a problem for an internal app), or a commercial
version for some serious $$$.

Thanks Pavel! that is very helpful! now i have no worries anymore:) as
you said, the interpretation of those bytes is up to us, so i will
discuss this with guys from other department to determine a Protocol
that both program understands.
 
Back
Top