Sunday, August 2, 2009

Are there class librarys to program linux/unix sockets in C++?

I am seen many examples of socket programming in C, but nothing in C++. I can get example programs in C to work, but they won't compile in C++ which is my language of choice. I'm not a good enough programmer to convert them to C++, and I don't know (or have the time) to study sockets in detail.





Are there class librarys or header files that would hide the complexities of network sockets from me?


For example, on the client side, just call a function that takes the port, ip address, and data.

Are there class librarys to program linux/unix sockets in C++?
Yes, there are. I believe there is one called ACE. Though I have never used it. Also, Qt by Trolltech has networking library, which is great because it is cross platform. However, if you want to work with sockets at a high level, I would suggest learning Python. It is a relatively easy language, once you get the hang of it. Plus, it can be embedded in C, so you can use the Python calls to set up the sockets in a C program.


No comments:

Post a Comment