I'm making a project on BeagleBone, and I write most of my program with C. However, socket programming in C looks more complicated than it should be, so I want to use another language for networking in my project. I thought of using C#, but I can't find any good tutorials abouts sockets in C#. What language would you recommend in such case?
-
2It's subjective, and depends on the application. But if resources are limited and you're already using C, why not just look for a C library that simplifies your task? – Dmitri Sep 10 '16 at 18:01
-
Your problem is you don't like the socket API; you have decided that the answer is to use a different language for the networking parts of your application, then you are asking a question about that. This is known as an XY problem. Ask a question about X rather than Y, because Y is not necessarily the only or best solution (and in this case is probably entirely inappropriate). – Clifford Sep 10 '16 at 18:31
1 Answers
You simply need a higher-level library, not an entirely different language.
C is extensible through libraries; if you don't like the basic BSD socket API choose (or write) a wrapper library with an API you are happier with. If you are using application layer protocols you probably want to do that in any case - the socket API accesses the transport layer (layer 4 in the OSI model) which is probably why you perceive it as being complicated from an application layer perspective.
There are many libraries that provide network services on top of the socket API. There are even more if you use C++ which is entirely interoperable with C code. If you were prepared to interoperate with another language in order to get network support, you might consider using C++ rather than C in any case and avoid any interoperability issues.
Take a look at the "question" Best C/C++ Network Library for a list of C and C++ networking libraries.