Starting with sockets in C++ [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm starting with sockets in C++ but saw 4 different libraries (or includes) that allows one to use sockets, like winsock.h sys/sockets.h, sfml and boost. My question is, what is the library/include that I should use?

It's kind of hilarious, but there's no single widely accepted socket library for C++.
It's not part of the standard library
Boost ASIO sacrifices simplicity for high performance
SFML socket looks pretty nice but it still includes a bunch of other headers
Windows and POSIX OS sockets have annoying small differences
Some experienced network programmer should write a nice, one-header socket class with all the necessary conditional compilation flags to work on multiple OSes.

If you're using a UNIX-like operating system, use sys/socket.h. It's part of the open standard. For Windows, you'll need to use the Winsock library, so you'll have to include winsock2.h instead (here's the docs on how to use that library).

Related

How to create a basic TCP connection via socks proxy in c++/c? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm looking for a library to add a socks proxy option to a C/C++ program.
What libraries are available for unix and what is the best way to achieve this?
The solution should:
be considered best practice (safe)
work in multi-threaded programs with short single-threaded connections
easy to implement / maintain (if possible)
work for unix (linux/debian/ubuntu)
Found a lot of information on the internet but nothing specific, and don't know what to use or when to use it.
I do recommend:
libboost: http://www.boost.org/doc/libs/1_35_0/doc/html/boost_asio/reference/ip__tcp/socket.html
Qt: http://qt-project.org/doc/qt-5.0/qtnetwork/examples-network.html
Both are multiplatform and very good libraries, but Qt is for GUIs more than a simple library, so think about using libboost for this single purpose.

What is the best library to work with archives [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I wonder, what library you would choose for the following:
I need to be able to combine a bunch of files and folders (a tree of filesystem structure) into one file - archive, thus having one composite file.
the library must be cross-platform: Windows 7 and Linux
it must provide access to the content and ability to extract only one file (e.g. if I have an archive of data folder and if I need only data/subdata/file, only it should be extracted)
it must have C++ (preferably) or C API
I am not particularly keen on archiving, but it would be desirable, since I will be storing mostly text files and they compress well...
Any feedback is highly appreciated!
zlib in combination with Boost Iostreams is a great combination. This does not do file level extraction though.
EDIT:
Some other options I found via another SO question include:
Zipios++
QuaZIP - Requires QT, may not build on Windows
correctly
EDIT2:
Minizip (usually included with zlib) will do the trick too - probably the most lightweight and commonly used solution.
Consider libarchive.
http://gnuwin32.sourceforge.net/packages/libarchive.htm
zlib is probably the safe answer.

Better logging library for C++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
In our project now we using log4cxx, but those library don't develope some years, also we have some problems with it.
Could you advise some library for logging in C++.
Library must support multithreade logging, system-log.
Also it'll be good if it support logging via << operator.
Also lib license must be very democracy - like boost, apache etc
Crossplatform support. Must support linux, windows. Better if it support solaris, aix, hp-ux, but it's not necessary.
boost::log is probably the most versatile and well-written logging library I've seen. It's pretty complicated but really genius at the same time. And it does everything you can think of and then some more.
I use the glog library, by google (because I could not install Boost.Log easily). It is both simple to use and powerfull.
We use log4cplus in our company, it provides a complex hierarchical logging system (based on log4j). It seems to have everything you are asking for. It provides many appenders (I personally choose this library for the rolling files linux/windows and linux Syslog).
The library is quite simple to compile and deploy on both linux & windows And do the job no problem so far (about 4 years in production).
Only drawback, the lack of documentation but the code it quite self-explanatory. Good new is you could go to the log4j documentation page to understand how configurators/patterns/etc works ...
Check out pantheios!

Best C++ RTP/RTSP library [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I'm looking for a RTP/RTSP library in C++. I found pjsip but it is more C-style. I'm looking for more OO library.
Check live555 Useful libraries and code examples of how to stream stuff from your own app. The repo is full of RTP, RTSP, and SIP code examples and libraries.
JRTPLIB is very nice, and used in well-known projects such as SightSpeed (and lots of little ones). Pretty well-designed, very flexible license; pretty easy to get things right with it.

Are there any good beginner tutorials for threads in windows? C++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Looking for a good site or book that explains windows threads, preferably for a beginner. Maybe has a example program to run, etc....
You want Chapter 20 of Programming Windows by Charles Petzold "Multitasking and Multithreading".
It also covers related things like synchronization, and events.
This book is a classic, and probably one of the best ways to get a very good understanding of how Windows Win32 programming works with C++.
Otherwise you can start on this MSDN pages for CreateThread.
For a more portable solution, boost threads are another way to go as well. Combined with boost::bind and several boost synchronization objects, it makes for a very powerful threading library.