C++ socket for windows and unix system - c++

I'm looking for an implementation of the socket in c + + (UDP/TCP).
This should work on Windows and UNIX systems.
suggest you know something good?
thanks

I know this is a comment but Boost ASIO library provides portable implementation of sockets. I've personally built boost for Windows which works for both Visual and gnu compilers. It also works on numerous other unix platforms. There is a decent description of how it works at http://boost.cowic.de/rc/pdf/asio_doc.pdf. The library itself also contains tutorials.
Edit: The license is also pretty good. My company is a stickler with third party software licenses (no GPL allowed) and they gave Boost a thumbs up which is pretty rare.

If you're looking for a tutorial:
http://beej.us/guide/bgnet/
If you're looking for a library:
http://www.alhem.net/Sockets/
If you're looking for a video:
http://www.youtube.com/watch?v=0-Uem2FzXXA
(the guy doesn't know what he's talking about, but it may help)
Otherwise, if you just want a custom lib, I may be able to help you (maaaybe)
-ultifinitus#gmail.com

I'm using Enet. Works well for what I'm doing. It does reliable and unreliable UDP

Related

Simpliest way to send http package on Windows and Mac

I have no expirience with C++, and I need to develop a plugin for an app written on C++ (for both its Windows and MacOS versions). The question is: what c++ lib dealing with HTTP(availible on Mac and Windows) you recomend to work with? Note that I do not need some extra functionality, simplicity is much more important.
Thank you in advance.
You can also use cpp-netlib
http://curl.haxx.se/libcurl/
libcurl is a C-based library that has a reasonably simple API that can be used from C++ as well.

Example of using UDP in obj-c/C++?

I'm making an iOS app - real-time game, wanna use UDP protocol. I'm searching a lot for examples/guides, but can't find any.
Also, the software on the server will use C++, and I've searched a lot and can't fina a nice way to use it, for begginers in C++...
I found that: http://developer.apple.com/mac/library/samplecode/PictureSharing/Introduction/Intro.html#//apple_ref/doc/uid/DTS10000712-Intro-DontLinkElementID_2
But it's using TCP.
So, if anyone have an example of usuing UDP in objective-c and C++...
Thanks!
Maybe have a look at UDT:
UDT -- UDP-based data transfer
http://udt.sourceforge.net/software.html
The UDT software is a C++ library containing the UDT API implementation and programming examples. The most recent version is UDT version 4, including 3 separate packages: pure source code, GNU package, and pre-compiled WIN32/i386 version. All UDT releases can be downloaded from UDT SourceForge project web site.
...
UDT supports Linux, Windows, OS X, and BSD.
See also:
http://digitalpbk.blogspot.com/2007/10/unix-networking-sockets-udp-transmitter.html

Cross Platform C++ webserver Library

I am looking for a cross platform Library in C++ that can run a web server.
Does any one know if tntnet can work on windows computers.
or libmicrohttpd
POCO has a HTTP server, among lots of other useful stuff. Runs on Windows, Linux, etc.
Currently tntnet does not support windows. It is possible to port tntnet to windows but nobody has done the work. Sorry.
The boost.asio library documentation includes several example HTTP servers
http://www.boost.org/doc/libs/1_42_0/doc/html/boost_asio/examples.html
I fond these extremely useful in developing an embedded web server for my own applications.
This might not answer your question directly, but if you have your heart set on one of those, you could always compile them in cygwin.

Which library would you consider on linux for DEA (Data Encryption Algorithm)?

I need a 3DES encrypt/decrypt library for my project.
Do you know an implementation working on linux ?
Linux is the target platform, but I essantially compile/debug on Windows. Therefore it could be really appreciated if it could work on Windows, while not mandatory.
OpenSSL is a very reputable, well tested open source security library. It's available for *nix and Windows. You can find it here
Edit, can't find a simple example right now. The API documentation is pretty good though.
There's a pre-compiled version for windows available for download from the openssl site. Most package managers will have a pre-packaged version of OpenSSL for Linux boxes, so you shouldn't have to compile your own version.
Look for Eric Young's "libdes".
This library can be also used on Windows as well as on Linux.
I have used botan before and I really like it. It has an implementation of not only 3DES but a lot of others algorithm. It is C++ so their API is Object Oriented (I like this feature while other might disagree). It supports a lot of systems (Windows, Linux, FreeBSD, etc), a lot of processors (x86, x86-64, IA-64, PowerPC and so on) and compilers. It seems to have a very good performance. Finally its license allows commercial developments.
At least it's Worth to have a look ;-)
you can compile libcrypto (openssl) for windows but I wouldn't recommend it:
http://www.pixelbeat.org/programming/lib_crypto.html
Maybe NSS used by firefox would be useful?
http://www.mozilla.org/projects/security/pki/nss/
Though I'd probably try something simple like:
http://www.lysator.liu.se/~nisse/nettle/nettle.html

getopt() in VC++

I'm quite fond of using GNU getopt, when programming under Linux. I understand, that getopt(), is not available under MS VC++.
Note:
Win32 environment
using Visual Studio
No Boost
No MFC
Not concerned with portability
Question:
How can I then port getopt() accordingly?
What guidelines should I be aware of while porting?
Known port with same features?
This may help, it's also very easy to integrate
http://www.codeproject.com/KB/cpp/xgetopt.aspx
There is some old code originally by IBM that is available as-is. It only has implementation for getopt, not the _long variants.
It's available on http://plexfx.org/news/files/70411c2c371bd686273a8bebc42c45c5-3.html
You will have to check out the license requirements, but the source to the GCC libraries is freely available. Just grab getopt() from there.