summaryrefslogtreecommitdiff
path: root/examples/network
Commit message (Collapse)AuthorAgeFilesLines
* Prepare existing files for building with MesonKjell Ahlstedt2020-03-011-3/+0
| | | | | | | | * examples/network/resolver.cc: Don't include config.h. It's not used. * glib/glibmm/ustring.cc: Check if GLIBMM_SIZEOF_WCHAR_T is defined. * tools/generate_wrap_init.pl.in: * tools/gmmproc.in: Change '\@' to '\ @'. Meson's configure_file() removes a backslash immediately before an at-sign.
* Avoid unnecessary conversions between std::string and Glib::ustringKjell Ahlstedt2019-11-181-10/+8
| | | | | A few implicit conversions in tests/ have been kept. They are probably deliberate, to test implicit conversion. Inspired by issue #65
* Glib::IOCondition: Add an IO_ prefix to the enumerator namesKjell Ahlstedt2017-09-053-6/+6
| | | | | | | IN and OUT can be preprocessor macros. IO_ is added to the enumerator names. E.g. Glib::IOCondition::IN is replaced by Glib::IOCondition::IO_IN. These enumerator names will be the same as before we used enum class. Bug 786717
* Update the Free Software Foundation address in copyright noticesKjell Ahlstedt2017-08-301-4/+2
| | | | Bug 786824
* Gio::Socket: Move enums into class.Murray Cumming2017-04-182-5/+5
|
* Fix make check when _WRAP_ENUM generates enum classKjell Ahlstedt2017-04-113-12/+12
| | | | Bug 86864
* Use std::dynamic_pointer_cast<>().Murray Cumming2017-04-073-3/+3
| | | | Instead of Glib::RefPtr<>::cast_dynamic().
* Gio::Resolver: Use std::vector instead of Glib::ListHandle<>.Murray Cumming2017-03-201-5/+3
| | | | | | Using Glib::ListHandler<>::list_to_array() and Glib::ListHandler<>::list_to_vector() instead, and only in the implementation instead of in the API.
* Examples: Network: Small const improvement.Murray Cumming2016-12-122-2/+2
| | | | Noticed by cppcheck.
* Run clang-format on the examples.Murray Cumming2016-02-263-736/+710
|
* C++11: Use emplace_back() instead of push_back().Murray Cumming2016-02-051-4/+4
|
* examples/network: Improve the time-out functionalityKjell Ahlstedt2015-12-062-25/+58
| | | | | | | * examples/network/socket-client.cc: * examples/network/socket-server.cc: Store the thread pointer in a std::unique_ptr. Then the thread is always joined and deleted. Stop the thread immediately in case of error, or if the user requests end of transmission.
* examples/tests: Use simpler std::thread constructor.Murray Cumming2015-11-263-15/+3
| | | | | Instead of using a lambda. As suggested by Kjell Ahlstedt: https://bugzilla.gnome.org/show_bug.cgi?id=757674#c10
* resolver example: Use std::mutex instead of G_LOCK_DEFINE_STATIC.Murray Cumming2015-11-261-7/+5
| | | | | As noticed by Kjell Ahlstedt: https://bugzilla.gnome.org/show_bug.cgi?id=757674#c10
* Network examples: Use std::thread instead of Glib::Threads::Thread.Murray Cumming2015-11-263-7/+52
| | | | Bug #757674
* resolver example: Use std:stoul instead of stdstrtoulMurray Cumming2015-09-011-1/+1
|
* resolver example: Use std::strtoul instead of strtoul.Murray Cumming2015-09-011-1/+1
|
* C++11: examples/tests: More use of auto.Murray Cumming2015-07-152-6/+6
|
* examples: Avoid more shadowed variables.Murray Cumming2015-07-152-4/+4
|
* C++11: examples: more use of auto.Murray Cumming2015-07-093-42/+30
|
* C++11: examples: Use nullptr.Murray Cumming2015-07-091-1/+1
|
* C++11: examples: No need for > > now.Murray Cumming2015-07-091-1/+1
|
* C++11: Use range-based for loops.Murray Cumming2015-07-091-9/+7
|
* Network example: Use Glib::OptionEntry and friendsKjell Ahlstedt2014-08-062-93/+142
| | | | | | * examples/network/socket-client.cc: * examples/network/socket-server.cc: Use Glib::OptionEntry, OptionGroup, OptionContext instead of the glib equivalents.
* Network example: Add --use-ipv6 command line optionShashank2014-08-062-3/+30
| | | | | | * examples/network/socket-client.cc: * examples/network/socket-server.cc: Add --use-ipv6 command line option. Bug #734094.
* examples/network: Use SocketSource and SignalSocket.Kjell Ahlstedt2014-05-152-24/+8
| | | | | | * examples/network/socket-client.cc: Use Gio::Socket::create_source(). * examples/network/socket-server.cc: Use Gio::signal_socket().connect(). Bug #725281.
* Revert "C++11: Use auto in examples."Murray Cumming2013-06-273-31/+47
| | | | | | This reverts commit 9b0554e2c9deca2399e654e7984c9dfe3b67e387. This was not meant to be in the master branch.
* C++11: Use auto in examples.Murray Cumming2013-06-263-47/+31
|
* Use std::size_t and std::ptrdiff_t.Kjell Ahlstedt2012-09-121-3/+3
| | | | | | | | | | | | | | | | | | * glib/glibmm/arrayhandle.h: * glib/glibmm/containers.h: * glib/glibmm/listhandle.h: * glib/glibmm/slisthandle.h: * glib/glibmm/vectorutils.h: Use std::size_t and std::ptrdiff_t instead of ::size_t and ::ptrdiff_t. Only the std versions are required to be declared in <cstddef>. * examples/network/resolver.cc: * glib/glibmm/containerhandle_shared.h: * glib/glibmm/helperlist.h: * glib/glibmm/main.h: * glib/glibmm/vectorutils.cc: Use std::size_t instead of ::size_t. * glib/src/convert.hg: Use std::size_t instead of ::size_t in a comment. * glib/glibmm/property.cc: * glib/glibmm/ustring.h: Use std::ptrdiff_t instead of ::ptrdiff_t.
* Fix exceptions thrown by Thread::create() and Threads::Thread::create.Kjell Ahlstedt2012-02-283-4/+3
| | | | | | | | | | | | | | | | | * glib/src/thread.ccg: create(): Call g_thread_try_new() instead of g_thread_new(). Throw a Glib::ThreadError when appropriate, instead of calling Glib::Error::throw_exception(), which would throw Glib::Threads::ThreadError. * glib/src/threads.ccg:create(): Call g_thread_try_new() instead of g_thread_new(). Remove parameter 'joinable'. * glib/src/threads.hg: Remove parameter 'joinable'. Remove comments about non-joinable threads and thread priorities. * examples/network/resolver.cc: * examples/network/socket-client.cc: * examples/network/socket-server.cc: * examples/thread/dispatcher.cc: * examples/thread/dispatcher2.cc: * examples/thread/thread.cc: Remove parameter 'joinable' in calls to Glib::Threads::Thread::create(). Bug #640029.
* Add Glib::Threads::* in threads.h, deprecating everything in thread.hMurray Cumming2011-11-233-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | * glib/src/filelist.am: * glib/src/thread.[hg|ccg]: Deprecate the whole file, adding deprecation doxygen comments to all API. * glib/src/threads.[hg|ccg]: A new Threads namespace containing equivalents for everything in thread.h, implemented using only non-deprecated glib API. This was necessary because we had to break the ABI to do this. * glib/glibmm.h: Include threads.h * glib/glibmm/main.[h|cc]: Added a wait() method overload that takes the new types, deprecating the existing wait() method. * examples/network/resolver.cc: * examples/network/socket-client.cc: * examples/network/socket-server.cc: * examples/thread/dispatcher.cc: * examples/thread/dispatcher2.cc: * examples/thread/thread.cc: * examples/thread/threadpool.cc: * glib/glibmm/dispatcher.cc: * glib/glibmm/exceptionhandler.cc: * glib/glibmm/threadpool.[h|cc]: Use the new Glib::Threads::* types instead of thread.h.
* Avoid use of deprecated API in tests and examples.Murray Cumming2011-10-262-4/+0
| | | | | | | | | | | * tests/Makefile.am: * examples/Makefile.am: Disable deprecated API. * examples/network/socket-client.cc: * examples/network/socket-server.cc: * examples/thread/dispatcher.cc: * examples/thread/dispatcher2.cc: * examples/thread/thread.cc: Remove calls to Glib::thread_init(), instead calling Glib::init() where that side-effect was also intended.
* Fix the make check build by always linking to gthread-2.0.Murray Cumming2011-10-251-24/+5
| | | | | | | | | | | | | * configure.ac: Always use gthread-2.0 because there is now no advantage to not doing that, because threading is now always enabled in glib. Remove the separate GTHREAD* variables. * glib/glibmm/Makefile.am: * gio/giomm/Makefile.am: * tests/Makefile.am: * tools/Makefile.am: * examples/Makefile.am: Remove use of the GTHREAD* variables.. * examples/network/resolver.cc: Remove the non-threading option and code that uses it.
* Update MSVC projects for 2.24Armin Burgmeier2010-04-022-3/+9
|
* Avoid compiler warning in resolver exampleDaniel Elstner2010-02-271-10/+16
| | | | | | | | | * examples/network/resolver.cc (interrupted): Check the return value of the write() call to avoid a warning from GCC. Save and restore the value of errno to make the signal handler reentrant. Get rid of the signal() call to re-establish the default handler, as there is not much of a point in doing so for this handler. (main): Create the pipe before installing the signal handler.
* fix warning in examples to make distcheck happyglibmm-2.23.0Jonathon Jongsma2010-01-023-9/+9
| | | | warnings are errors in distcheck
* Fix another bug in resolver exampleJonathon Jongsma2010-01-021-28/+33
| | | | | I wasn't splitting the service triples properly. resolving a service should work now. For example, try: ./resolver xmpp-server/tcp/google.com
* Take an extra ref from the return of g_inet_socket_address_get_addressJonathon Jongsma2010-01-021-3/+0
| | | | This was causing a bunch of warnings in the examples
* Add socket-server exampleJonathon Jongsma2010-01-021-0/+305
| | | | | InetAddress needed a couple additions / modifications for the example to work properly.
* Add socket-client exampleJonathon Jongsma2010-01-021-0/+294
|
* Re-enable network IO stuff (Socket, Resolver, etc)Jonathon Jongsma2009-11-281-0/+529
There is a bit of a problem with some of the async stuff that is exhibited by the included resolver example. For example, when run the example with the following arguments: ./resolver -c domain.com There are several critical warnings printed to the terminal, and I have not been able to debug it to find the cause yet. I think it must have something to with the lifetime of the enumerator object during the next_async() calls and sigc::bind, etc. but I can't figure it out yet.