Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I was wondering if there was an API to do networking that would work on Windows, Mac and Linux. I would like to make a card game that 2 people can play through a TCP connection.
There are a few options for this, some easier to use than others:
APR (Apache Portable Runtime) - Very popular. Quite easy to use. Includes lots of additional features handy for network programming (threads, mutexes, etc.)
ACE - Popular among the embedded space. Personally, I found it quite a complicated API, and not very straightforward to use.
Boost - If you have a decent level of sophistication with C++ (templates, metaprogramming, etc.), then Boost libraries are generally very good. I'm not sure how popular the Boost asynchronous networking libraries are in the real world.
QT - Popular as a UI toolkit, but has a great set of threading, event management, networking libraries. IMO, this is by far the easiest to use.
It's important to stay away from using the berkeley sockets library, as the implementations across operating systems vary wildly, and you'll lose a fair bit of time to tuning them as you port your software across OSs.
My personal preference: APR.
most of the berkeley sockets api works everywhere.
You can use ACE or Boost.Asio:
About ACE:
Increased portability -- ACE components make it easy to write concurrent networked applications on one OS platform and quickly port them to many other OS platforms. Moreover, because ACE is open source, free software, you never have to worry about getting locked into a particular operating system platform or compiler configuration.
About boost:
Boost.Asio is a cross-platform C++ library for network and low-level I/O programming that provides developers with a consistent asynchronous model using a modern C++ approach.
The NRL has a really great library of networking methods that supports a large variety of platforms. They have excellent support from the actual developers on their mailing lists as well.
Protolib
For this simple application you can use the standard "Berkeley socket" functions that are mostly portable. You can also use Boost's abstractions.
If you needed security functions like SSL/TLS (which you don't need for a simple game I guess), there are open source libraries like OpenSSL, GNU TLS, Mozilla NSS.
I've got a feeling the Apache Portable Runtime might help with what you're looking for. Apache HTTPD used this library internally to abstract its platform-specific code so that the server code focuses on the logic and calls the methods in the APR and these translate to underlying operating system functions.
Of course, it might have more tools in it than you strictly need...
Synapse is good multiplatform network library. Open source and very easy to use.
http://www.ararat.cz/synapse/doku.php/download
SDL Net is a very simple abstraction layer on top of sockets, that's very easy to use. See http://www.libsdl.org/projects/SDL_net.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
The community reviewed whether to reopen this question 9 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
So I have trawled through pages and pages of search results on StackOverflow and Google and I have come across very few C/C++ HTTP client libraries suitable for a resource-constrained, embedded environment (e.g. an ARM). I have however come across quite a few that are suitable for desktop-class applications.
Essentially, I am after a simple, easy-to-use and convenient API to make HTTP GET, POST and HEAD calls (with support for authentication, download resume and payload compression). It would be ideal if it had a small footprint (i.e. no or minimal external dependencies) and is open-source (with a permissive license).
Here's a list of what I've come across so far and why they are not suitable -
curl - too heavyweight
poco - too heavyweight
neon - GPL
qlibc - relies on POSIX libraries
cpp-netlib - relies on Boost libraries
serf - relies on the Apache Portable Runtime library
urdl - relies on Boost libraries
HTTP Client C API - promising but requires a C++ wrapper
Are there any libraries out there that I am unaware of or am I better off rolling my own?
Have you taken a look at the HTTPClient on mbed? Looks like there are lots of forks of an original from a few years ago that wasn't maintained. I haven't used this...
http://mbed.org/users/WiredHome/code/HTTPClient/
I can just describe what I used for those tasks.
curl - if you are lazy, you can just download in built binary and have nothing to do more, it has very simple headers and a lot of examples. You will need 3-4 already built libraries and header. With no external dependencies. So, I would count it as too low-level, but not heavyweight at all.
boost.asio - very interesting paradigm of realization, quite easy and clean. But I would say it is low-level too. Harder then curl. And needs to use boost, that is external dependency you want to avoid, I guess.
poco - best solution for http server. It's high level, after you joined it to your application, you just need to implement few virtual functions, having all other work (and thread management) done. Poco gives a lot of stuff for application management, thread/process management and it is very simple and easy, I would even say it has java-like interface. Yes, there is external dependency to poco, but I would look at this as a chance to learn perfect library. Still, for http clients it is really heavy.
That is all my C++ experience with HTTP. Counting you need just client and don't need dependencies, I would offer you to look at libcurl library. It's cross-platform, easy, no dependencies and low-level enough to get all you need with network. And if you will have time - look at Poco, really, I believe you will fell in love with this library as I did.
Hope that will be helpful.
I found another one, which just needs to be packed into a lib.
didn't test it, but may be worth a look:
https://github.com/reagent/http.git
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Like Qt , do we have any core application development framework in c++.
I think the qt is mainly for GUI applications . I need something other than QT , which gives a much faster running code ...
Visual Studio for c++ is a good choice , but its not an open source and cross platform one ..
To put it bluntly, to me it sounds like you're wasting your time and do not have clearly defined goal for your application. No framework can fix this problem. Write down application specification, list of target platform, check what functionality is required but missing, search for existing libraries, then use them.
I think the qt is mainly for GUI applications
You're mistaken.
In Qt 4 GUI component is optional. You are free to design console applications using QCoreApplication instead of QApplication for application object. As a bonus you get access to some GUI-related classes (not all of them, though - many require QApplication).
which gives a much faster running code
Making code run fast is your responsibility. If it runs slowly, then it is your fault until proven otherwise. Qt 4 is very fast, at least as far as GUI performance is concerned. Poor selection of algorithms, abuse of memory allocation routines and many other things can negatively impact performance. Switching to different framework won't fix those. Instead of searching for different tool, profile your code, search for bottlenecks and fix them.
Visual Studio for c++ is a good choice
It is not cross-platform. It is also not a framework - only IDE+compiler.
Cross Platform
Depending on your application you could even develop cross-platform application in standard C++ without any frameworks while using CMake/Scons/Autotools for build process. Unix-like environments have POSIX standard they more or less attempt to conform to, which can be used (on windows it requires cygwin/msys to be functional). Aside from that there's Boost. You could even ditch C++ and switch to scripted language to ensure portability. It all depends n your goals. Since you haven't said what you're writing it isn't possible to recommend anything specific aside from Boost. In addition to boost there are several frameworks (wxWidgets, Fox Toolkit, GTK) that may or may not meet your requirements.
Since it is not exacly clear what you mean by framework you might want to clarify that a bit more. Anyways, I am a happy user of boost as libraries for generic functionality and use eclipse + cdt as IDE to do coding and debugging. Boost, eclipse and the cdt are open source and cross-platform.
Which features should have the framework? How about the BOOST? It's not a framework as QT and wxWidgets, but it has a lot of features like delegates aka signals, threads, inter-process communications, network, etc.
I'm looking for a CORBA kit. I need the IDL compiler plus libraries (or source) for the ORB. I don't really know a helluva lot more about CORBA, but we need to interface with a server whose functions are exposed via CORBA.
The requirements I've been given, in rough order of priority are:
1 - Low cost or license amenable to commercial (closed source) use.
2 - Performance performance performance - is there a Boost::ASIO based ORB?
3 - Simple to integrate for at least Windows and Linux development.
We measure our software's performance in microseconds, so I need to be sure that the underlying network latency has been kept to an absolute minimum, but also, personally, I don't want to wrestle with a half-finished or half-working project and I don't want integrating this stuff to become the whole project. Essentially I need to get this API built and be calling remote functions with as little fuss as possible. That might just be wishful thinking, but it's worth mentioning.
So, has anyone out there had RECENT experience integrating CORBA into modern desktop application project? What would you recommend to use, and what should I beware of?
I'm currently using omniorb for an embedded software in the telecommunication field.
As for your questions:
It is free even for commercial use. It comes with a LGPL license
I haven't mesured performances, but I've got good results in an embedded real-time project. (About your question on boost::asio: I'm pretty sure that an ORB based on boost::asio doesn't exist)
It's been tested on many platforms, including linux and windows.
Maybe you could give a try to omniorb. Otherwise you could try TAO: it's a real-time ORB, but I never used it.
As far as I know there is no ORB that is bui;d on top of boost::asio. I would recommend you to have a look at TAO or TAOX11 which is a modern CORBA implementation. There is a free CORBA Programmers Guide with some starter information by Remedy IT, or the OCI Developers Guide.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I'm trying to find a good library for calculating sha256. I found already a lot of options
crypto++ : http://www.cryptopp.com/
openSSL: http://www.openssl.org/
MIRACL: http://www.shamus.ie/
I would much prefer a library that's well-known, widely industrially used and works on all operating systems, rather than the most efficient one.
What do you recommend for me? (feel free to recommend on a library that I didn't mention here).
You should consider cryptlib
Works on all operating systems
Cryptlib is supplied as source code for AMX, BeOS, ChorusOS, DOS, DOS32, eCOS, µC/OS-II, embedded Linux, FreeRTOS/OpenRTOS, IBM MVS, µITRON, Macintosh/OS X, OS/2, PalmOS, RTEMS, Tandem, ThreadX, a variety of Unix versions (including AIX, Digital Unix, DGUX, FreeBSD/NetBSD/OpenBSD, HP-UX, IRIX, Linux, MP-RAS, OSF/1, QNX, SCO/UnixWare, Solaris, SunOS, Ultrix, and UTS4), uClinux, VM/CMS, VxWorks, Windows 3.x, Windows 95/98/ME, Windows CE/PocketPC/SmartPhone, Windows NT/2000/XP/Vista/Windows 7 (32- and 64-bit versions), VDK, and Xilinx XMK. cryptlib’s highly portable nature means that it is also being used in a variety of custom embedded system environments.
Widely industrially used
see Clients
It's not free for commercial use, though.
I've recently needed a small library to do some hashing.
After lots of searching, I found this little one : https://create.stephan-brumme.com/hash-library/ .
Its a tiny single-headered library (or bunch of standalone implementations really) that one can use. it supports sha1,sha256, sha3, etc.
Just include the header you need and you are done.
There is also s2n: a C99 implementation of the TLS/SSL protocols that is designed to be simple, small, fast, and with security as a priority. It is released and licensed under the Apache License 2.0.
s2n hash functions.
See also the implementation in Mbed TLS: https://tls.mbed.org/
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm looking for something to abstract the standard operating system functionality in C/C++: span/kill a thread, send/receive a message, start/stop a timer, maybe even memory management, although I can probably handle that myself with my own buffer pool.
I want to to be able to develop and unit test on Linux/windows and then recompile the c/c++ code for various target O/Ses (for embedded systems: eCos, FreeRTOS, VxWorks, etc)
Something as "light" as possible would be best, hopefully just a library, maybe even a collection of macros.
Have you looked at the Boost library? It has threads, timers, memory management, and a signals library.
The library is not a small download, but most of the library components are header-only implementations (though the OS abstraction libraries tend to have to be linked), and you only have to use what you need.
I keep a (long) list of OS Abstraction Libraries. Hope it helps.
Why don't you directly call only POSIX functions (POSIX1 seems to fill all your needs) and install a POSIX layer above non-compliant operating system (to be read as Microsoft Windows)?
I think boost is worth to look into; it can provide you an os abstraction, but also a compiler independence, and much, much more. It does require C++ of course. Other options: Posix.
In your list:
eCos, VxWorks, Linux : good posix support, so you can use this.
freertos: see link
Windows lacks good posix support out of the box (see wikipedia Posix)
If cygwin is ok for you, you can propably use it. If you need to mix with Visual Studio, a library like boost seems more interesting (you'd abstract away from it)