Example of using UDP in obj-c/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

Related

REST client in C++

Has anybody successfully tried any C++ REST library (client) in their enterprise product? It can be collection of software stack, but it should have the capability to run on all platforms, i.e.: Windows, Linux, Solaris, AIX, HP-UX.
You may want to check thin REST client for C++ at https://github.com/mrtazz/restclient-cpp.
It is a C++ wrapper around good and stable multiprotocol, multiplatform libcurl library.
C++ REST SDK is an actively developed C++ REST client that is currently supported in Windows, Mac OS X, iOS and Android. It is also licensed under Apache License 2.0 which opens up a range of customizations on the library to suit your needs.
Here is the list for most useful C++ libraries include network library:
https://en.cppreference.com/w/cpp/links/libs
you can see listed can be used as REST client library:
Boost.Beast
C++ REST SDK
curlpp
I cannot recommend any integrated solution but what you can do is use:
Transport: neon, serf or libcurl (all of them have advs and disadvs)
XML parsing: libexpat or libxml2
JSON parsing: Jansson or JSON Spirit

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.

c++ xml, tcp/ip libraries for Windows and Linux

I have this C# client that's handling xml and tcp/ip messages, and I have to convert it to C++, BUT - I have to convert it to C++ in such a way that it will run on both Windows and Linux. Is there a set of standard libraries for xml and tcp/ip that I can use on both Windows and Linux? Sorry if this sounds like a stupid question - I'm very familiar with C# and .NET, but I'm not very familiar with native C++ - I don't really know any of the standard libraries, just the syntax.
In case it helps, here's the exact message from the boss.
1) read/create very simple XML, and
2) receive/send TCP messages from C++ using a library that exists on both Windows and Linux. Hopefully there is one and you can then develop on Windows and just do a quick test on Linux.
Qt will do what you want.
TCP Sockets
XML Parsing
Also seconding Dani's suggestion that you might as well try to run C# applications on Mono before porting to C++.
The Qt framework not only provides graphical toolkits, but also a C++ framework for portable network applications (same code using Qt should work on Windows, Linux, MacOSX), notably thru its QtNetwork module. (You can use Qt without any graphics involved).
Themel has already answer this. I just want to help with this answer.
When i was implementing this in QT4 it gives error: QtNetwork and QTWidget not found. To solve this error in QT4 -
1. remove #include and add #include
2. add QT += network in your project (.pro) file.

Cross platform open source third party library for WebServices

I'm looking for cross platform open source third party library for web services which support c++. I have generated c++ files using WSMakeStubs utility but it uses Core Foundation data types. I want a library which provide web service call through c++ so that I can use it on Windows and Mac both the platform.
I wanted stubs that can be used on both Windows and Mac platform.
Could any one suggest me good library.
thanks
I would like to recommend gSoap. In the company I'm working at, we use it for about 7 years now (since version 2.6.0, the actual version is 2.8.3) and only made good experiences with it. Look at the success stories to get an overview of the companies which are using it.
Related:
C++ and SOAP
What is a good platform for devoloping web services in C++?
A Good C++ Library for SOAP
pion is a possibility, though I don't know how it compares to gSoap or other alternatives. I got it working an evening then got distracted with other reverse economies. I seem to remember it having fewer dependencies of the others I researched.

C++ socket for windows and unix system

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