开发者

TCP between Windows .NET program in C# to Linux program in C++

I am new to the topic of computer networking and sending data to one computer to another. Currently I am tasked w开发者_运维百科ith integrating a C# Kinect SDK program with a Linux C++ Opengl/Covise program. The C++ program is to then receive and make use of the output generated by the Kinect.

Is it possible to have them communicate to one another via TCP, UDP, or anything despite being written on different platforms and languages? Or would it be best to extend the C++ program with OpenNI?

Currently installing Opencover/Covise is a big pain for me.


Of course. When it comes to networking, it doesn't matter what programming language the server and clients are written in. Do you really think multiplayer flash games has a flash server running on the backend?

You can find a bunch of articles online on how to write servers and clients, how to open ports and listen for connections, work with sockets. etc.


I new to the topic of computer networking and sending data to one computer to another. Currently I am tasked with integrating a C# Kinect SDK program with a Linux C++ Opengl/Covise program.

Cool, congrats on learning new stuff.

Is it possible to have them communicate to one another via TCP, UDP, or anything despite being written on different platforms and languages?

This would be the purpose of having a "protocol" that we all agree on. Much like how shaking hands works. We all agree that's how it should be, so that's how it is. As opposed to answering the phone and saying hello, wherein the reason for saying hello is to give the other ear a couple of syllables to recognize the timber and tone of your voice before digesting the next bit of the message (truth). (Which is also why we do handshakes on networking - establish that you're talking to someone, then start talking.)

Or would it be best to extend the C++ program with OpenNI?

If that's the requirement for the assignment, then do that, but I don't think adding in another library is necessarily the best answer. I would stick to simpler tasks.


You can definitely communicate across languages and platforms over a network (TCP/UDP). The number one thing you need to worry about is how you serialize and deserialize the data or messages you are communicating. For example one platform could store integers in little endian byte order, and another might use big endian byte order (also called network byte order). Additionally complex datastructures or objects need to be serialized such that they can be interpreted easily by the other platform, you cannot just use System.Serialization in C# for example and expect it to be easy to decode on the other end. There are many toolkits or APIs for cross platform communication such as Swift, Protocol Buffers, SOAP, POX/REST, etc. These all have various trade offs that may make them more or less appropriate for your specific application.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜