[glibmm] Wrap SocketListener



commit 006cf3c38cf862084de88c89faf3c1c868a764fb
Author: Jonathon Jongsma <jonathon quotidian org>
Date:   Sat Jan 2 22:08:46 2010 -0600

    Wrap SocketListener

 gio/src/filelist.am        |    1 +
 gio/src/socketlistener.ccg |  484 ++++++++++++++++++++++++++++++++++++++++++++
 gio/src/socketlistener.hg  |  195 ++++++++++++++++++
 3 files changed, 680 insertions(+), 0 deletions(-)
---
diff --git a/gio/src/filelist.am b/gio/src/filelist.am
index 4303780..c791d45 100644
--- a/gio/src/filelist.am
+++ b/gio/src/filelist.am
@@ -58,6 +58,7 @@ giomm_files_any_hg =			\
 	socketclient.hg		\
 	socketconnectable.hg		\
 	socketconnection.hg		\
+	socketlistener.hg		\
 	srvtarget.hg			\
 	tcpconnection.hg			\
 	themedicon.hg			\
diff --git a/gio/src/socketlistener.ccg b/gio/src/socketlistener.ccg
new file mode 100644
index 0000000..fb4c203
--- /dev/null
+++ b/gio/src/socketlistener.ccg
@@ -0,0 +1,484 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* Copyright (C) 2010 Jonathon Jongsma
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gio/gio.h>
+#include "slot_async.h"
+
+namespace Gio
+{
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool SocketListener::add_socket(const Glib::RefPtr<Socket>& socket)
+#else
+bool SocketListener::add_socket(const Glib::RefPtr<Socket>& socket, std::auto_ptr<Glib::Error>& error)
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+{
+        GError* gerror = 0;
+        bool retval;
+        retval = g_socket_listener_add_socket (gobj(),
+                                               socket->gobj(),
+                                               0,
+                                               &gerror);
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+        if(gerror)
+                ::Glib::Error::throw_exception(gerror);
+#else
+        if(gerror)
+                error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+        return retval;
+}
+
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool SocketListener::add_address(const Glib::RefPtr<SocketAddress>& address, SocketType type, SocketProtocol protocol, const Glib::RefPtr<Glib::Object>& source_object, Glib::RefPtr<SocketAddress>& effective_address)
+#else
+bool SocketListener::add_address(const Glib::RefPtr<SocketAddress>& address, SocketType type, SocketProtocol protocol, const Glib::RefPtr<Glib::Object>& source_object, Glib::RefPtr<SocketAddress>& effective_address, std::auto_ptr<Glib::Error>& error)
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  bool retval;
+  GSocketAddress *retaddr = NULL;
+  retval = g_socket_listener_add_address (gobj(),
+                                          address->gobj(),
+                                          static_cast<GSocketType>(type),
+                                          static_cast<GSocketProtocol>(protocol),
+                                          source_object->gobj(),
+                                          &retaddr,
+                                          &gerror);
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+  if (retaddr)
+    effective_address = Glib::wrap(retaddr);
+  return retval;
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool SocketListener::add_address(const Glib::RefPtr<SocketAddress>& address, SocketType type, SocketProtocol protocol, Glib::RefPtr<SocketAddress>& effective_address)
+#else
+bool SocketListener::add_address(const Glib::RefPtr<SocketAddress>& address, SocketType type, SocketProtocol protocol, Glib::RefPtr<SocketAddress>& effective_address, std::auto_ptr<Glib::Error>& error)
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  bool retval;
+  GSocketAddress *retaddr = NULL;
+  retval = g_socket_listener_add_address (gobj(),
+                                          address->gobj(),
+                                          static_cast<GSocketType>(type),
+                                          static_cast<GSocketProtocol>(protocol),
+                                          0,
+                                          &retaddr,
+                                          &gerror);
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+  if (retaddr)
+    effective_address = Glib::wrap(retaddr);
+  return retval;
+}
+
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool SocketListener::add_inet_port(guint16 port)
+#else
+bool SocketListener::add_inet_port(guint16 port, std::auto_ptr<Glib::Error>& error)
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  bool retvalue = g_socket_listener_add_inet_port(gobj(), port, 0, &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+  return retvalue;
+
+}
+
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+guint16 SocketListener::add_any_inet_port()
+#else
+guint16 SocketListener::add_any_inet_port(std::auto_ptr<Glib::Error>& error)
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  guint16 retvalue = g_socket_listener_add_any_inet_port(gobj(), 0, &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+  return retvalue;
+}
+
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<Socket> SocketListener::accept_socket(Glib::RefPtr<Glib::Object>& source_object, const Glib::RefPtr<Cancellable>& cancellable)
+#else
+Glib::RefPtr<Socket> SocketListener::accept_socket(Glib::RefPtr<Glib::Object>& source_object, const Glib::RefPtr<Cancellable>& cancellable, std::auto_ptr<Glib::Error>& error)
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  GObject *retobj;
+  GSocket* retvalue = g_socket_listener_accept_socket(gobj(),
+                                                      &retobj,
+                                                      cancellable->gobj(),
+                                                      &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+  if (retobj)
+    source_object = Glib::wrap(retobj);
+
+  return Glib::wrap(retvalue);
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<Socket> SocketListener::accept_socket(Glib::RefPtr<Glib::Object>& source_object)
+#else
+Glib::RefPtr<Socket> SocketListener::accept_socket(Glib::RefPtr<Glib::Object>& source_object, std::auto_ptr<Glib::Error>& error)
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  GObject *retobj;
+  GSocket* retvalue = g_socket_listener_accept_socket(gobj(),
+                                                      &retobj,
+                                                      0,
+                                                      &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+  if (retobj)
+    source_object = Glib::wrap(retobj);
+
+  return Glib::wrap(retvalue);
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<Socket> SocketListener::accept_socket(const Glib::RefPtr<Cancellable>& cancellable)
+#else
+Glib::RefPtr<Socket> SocketListener::accept_socket(const Glib::RefPtr<Cancellable>& cancellable, std::auto_ptr<Glib::Error>& error)
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  GSocket* retvalue = g_socket_listener_accept_socket(gobj(),
+                                                      0,
+                                                      cancellable->gobj(),
+                                                      &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+  return Glib::wrap(retvalue);
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<Socket> SocketListener::accept_socket()
+#else
+Glib::RefPtr<Socket> SocketListener::accept_socket(std::auto_ptr<Glib::Error>& error)
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  GSocket* retvalue = g_socket_listener_accept_socket(gobj(),
+                                                      0,
+                                                      0,
+                                                      &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+  return Glib::wrap(retvalue);
+}
+
+
+void SocketListener::accept_socket_async(const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot)
+{
+  // Create a copy of the slot.
+  // A pointer to it will be passed through the callback's data parameter
+  // and deleted in the callback.
+  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+
+  g_socket_listener_accept_socket_async(gobj(),
+                                        cancellable->gobj(),
+                                        &SignalProxy_async_callback,
+                                        slot_copy);
+}
+
+void SocketListener::accept_socket_async(const SlotAsyncReady& slot)
+{
+  // Create a copy of the slot.
+  // A pointer to it will be passed through the callback's data parameter
+  // and deleted in the callback.
+  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+
+  g_socket_listener_accept_socket_async(gobj(),
+                                        0,
+                                        &SignalProxy_async_callback,
+                                        slot_copy);
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<Socket> SocketListener::accept_socket_finish(const Glib::RefPtr<AsyncResult>& result, Glib::RefPtr<Glib::Object>& source_object)
+#else
+Glib::RefPtr<Socket> SocketListener::accept_socket_finish(const Glib::RefPtr<AsyncResult>& result, Glib::RefPtr<Glib::Object>& source_object, std::auto_ptr<Glib::Error>& error)
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  GObject *retobj = 0;
+  GSocket* retvalue = g_socket_listener_accept_socket_finish(gobj(),
+                                                             result->gobj(),
+                                                             &retobj,
+                                                             &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+  if (retobj)
+    source_object = Glib::wrap(retobj);
+
+  return Glib::wrap(retvalue);
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<Socket> SocketListener::accept_socket_finish(const Glib::RefPtr<AsyncResult>& result)
+#else
+Glib::RefPtr<Socket> SocketListener::accept_socket_finish(const Glib::RefPtr<AsyncResult>& result, std::auto_ptr<Glib::Error>& error)
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  GSocket* retvalue = g_socket_listener_accept_socket_finish(gobj(),
+                                                             result->gobj(),
+                                                             0,
+                                                             &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+  return Glib::wrap(retvalue);
+}
+
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<SocketConnection> SocketListener::accept(Glib::RefPtr<Object>& source_object, const Glib::RefPtr<Cancellable>& cancellable)
+#else
+Glib::RefPtr<SocketConnection> SocketListener::accept(Glib::RefPtr<Object>& source_object, const Glib::RefPtr<Cancellable>& cancellable, std::auto_ptr<Glib::Error>& error)
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  GObject *retobj = 0;
+  GSocketConnection* retvalue = g_socket_listener_accept(gobj(),
+                                                         &retobj,
+                                                         cancellable->gobj(),
+                                                         &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+  if (retobj)
+    source_object = Glib::wrap(retobj);
+
+  return Glib::wrap(retvalue);
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<SocketConnection> SocketListener::accept(Glib::RefPtr<Object>& source_object)
+#else
+Glib::RefPtr<SocketConnection> SocketListener::accept(Glib::RefPtr<Object>& source_object, std::auto_ptr<Glib::Error>& error)
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  GObject *retobj = 0;
+  GSocketConnection* retvalue = g_socket_listener_accept(gobj(),
+                                                         &retobj,
+                                                         0,
+                                                         &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+  if (retobj)
+    source_object = Glib::wrap(retobj);
+
+  return Glib::wrap(retvalue);
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<SocketConnection> SocketListener::accept(const Glib::RefPtr<Cancellable>& cancellable)
+#else
+Glib::RefPtr<SocketConnection> SocketListener::accept(const Glib::RefPtr<Cancellable>& cancellable, std::auto_ptr<Glib::Error>& error)
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  GSocketConnection* retvalue = g_socket_listener_accept(gobj(),
+                                                         0,
+                                                         cancellable->gobj(),
+                                                         &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+  return Glib::wrap(retvalue);
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<SocketConnection> SocketListener::accept()
+#else
+Glib::RefPtr<SocketConnection> SocketListener::accept(std::auto_ptr<Glib::Error>& error)
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  GSocketConnection* retvalue = g_socket_listener_accept(gobj(),
+                                                         0,
+                                                         0,
+                                                         &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+  return Glib::wrap(retvalue);
+}
+
+
+void SocketListener::accept_async(const SlotAsyncReady& slot)
+{
+  // Create a copy of the slot.
+  // A pointer to it will be passed through the callback's data parameter
+  // and deleted in the callback.
+  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+
+  g_socket_listener_accept_async(gobj(),
+                                 0,
+                                 &SignalProxy_async_callback,
+                                 slot_copy);
+}
+
+void SocketListener::accept_async(const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot)
+{
+  // Create a copy of the slot.
+  // A pointer to it will be passed through the callback's data parameter
+  // and deleted in the callback.
+  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+
+  g_socket_listener_accept_async(gobj(),
+                                 cancellable->gobj(),
+                                 &SignalProxy_async_callback,
+                                 slot_copy);
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<SocketConnection> SocketListener::accept_finish(const Glib::RefPtr<AsyncResult>& result, Glib::RefPtr<Glib::Object>& source_object)
+#else
+Glib::RefPtr<SocketConnection> SocketListener::accept_finish(const Glib::RefPtr<AsyncResult>& result, Glib::RefPtr<Glib::Object>& source_object, std::auto_ptr<Glib::Error>& error)
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  GObject *retobj = 0;
+  GSocketConnection* retvalue = g_socket_listener_accept_finish(gobj(),
+                                                                result->gobj(),
+                                                                &retobj,
+                                                                &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+  if (retobj)
+    source_object = Glib::wrap(retobj);
+
+  return Glib::wrap(retvalue);
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<SocketConnection> SocketListener::accept_finish(const Glib::RefPtr<AsyncResult>& result)
+#else
+Glib::RefPtr<SocketConnection> SocketListener::accept_finish(const Glib::RefPtr<AsyncResult>& result, std::auto_ptr<Glib::Error>& error)
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+{
+  GError* gerror = 0;
+  GSocketConnection* retvalue = g_socket_listener_accept_finish(gobj(),
+                                                                result->gobj(),
+                                                                0,
+                                                                &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+  return Glib::wrap(retvalue);
+}
+
+} // namespace Gio
diff --git a/gio/src/socketlistener.hg b/gio/src/socketlistener.hg
new file mode 100644
index 0000000..5f7ccbd
--- /dev/null
+++ b/gio/src/socketlistener.hg
@@ -0,0 +1,195 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* Copyright (C) 2010 Jonathon Jongsma
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <glibmm/object.h>
+#include <giomm/enums.h>
+#include <giomm/socket.h>
+#include <giomm/socketconnection.h>
+#include <giomm/asyncresult.h>
+
+_DEFS(giomm,gio)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Gio
+{
+
+/** @defgroup NetworkIO Portable Network I/O Functionality
+ */
+
+/**
+ * Helper for accepting network client connections
+ *
+ * @see ThreadedSocketService, SocketService.
+ *
+ * A SocketListener is an object that keeps track of a set
+ * of server sockets and helps you accept sockets from any of the
+ * socket, either sync or async.
+ *
+ * If you want to implement a network server, also look at SocketService
+ * and ThreadedSocketService which are subclass of SocketListener
+ * that makes this even easier.
+ *
+ * @newin{2,24}
+ * @ingroup NetworkIO
+ */
+class SocketListener : public Glib::Object
+{
+    _CLASS_GOBJECT(SocketListener, GSocketListener, G_SOCKET_LISTENER, Glib::Object, GObject)
+
+protected:
+    _CTOR_DEFAULT
+public:
+    _WRAP_CREATE()
+
+_WRAP_METHOD(void set_backlog(int listen_backlog), g_socket_listener_set_backlog)
+
+_WRAP_METHOD(bool add_socket(const Glib::RefPtr<Socket>& socket, const Glib::RefPtr<Glib::Object>& source_object), g_socket_listener_add_socket, errthrow)
+_WRAP_METHOD_DOCS_ONLY(g_socket_listener_add_socket)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool add_socket(const Glib::RefPtr<Socket>& socket);
+#else
+bool add_socket(const Glib::RefPtr<Socket>& socket, std::auto_ptr<Glib::Error>& error);
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+
+_IGNORE(g_socket_listener_add_address)
+_WRAP_METHOD_DOCS_ONLY(g_socket_listener_add_address)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool add_address(const Glib::RefPtr<SocketAddress>& address, SocketType type, SocketProtocol protocol, const Glib::RefPtr<Glib::Object>& source_object, Glib::RefPtr<SocketAddress>& effective_address);
+#else
+bool add_address(const Glib::RefPtr<SocketAddress>& address, SocketType type, SocketProtocol protocol, const Glib::RefPtr<Glib::Object>& source_object, Glib::RefPtr<SocketAddress>& effective_address, std::auto_ptr<Glib::Error>& error);
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+_WRAP_METHOD_DOCS_ONLY(g_socket_listener_add_address)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool add_address(const Glib::RefPtr<SocketAddress>& address, SocketType type, SocketProtocol protocol, Glib::RefPtr<SocketAddress>& effective_address);
+#else
+bool add_address(const Glib::RefPtr<SocketAddress>& address, SocketType type, SocketProtocol protocol, Glib::RefPtr<SocketAddress>& effective_address, std::auto_ptr<Glib::Error>& error);
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+
+_WRAP_METHOD(bool add_inet_port(guint16 port, const Glib::RefPtr<Glib::Object>& source_object), g_socket_listener_add_inet_port, errthrow)
+_WRAP_METHOD_DOCS_ONLY(g_socket_listener_add_inet_port)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool add_inet_port(guint16 port);
+#else
+bool add_inet_port(guint16 port, std::auto_ptr<Glib::Error>& error);
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+
+_WRAP_METHOD(guint16 add_any_inet_port(const Glib::RefPtr<Glib::Object>& source_object), g_socket_listener_add_any_inet_port, errthrow)
+_WRAP_METHOD_DOCS_ONLY(g_socket_listener_add_any_inet_port)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+guint16 add_any_inet_port();
+#else
+guint16 add_any_inet_port(std::auto_ptr<Glib::Error>& error);
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+
+_IGNORE(g_socket_listener_accept_socket)
+_WRAP_METHOD_DOCS_ONLY(g_socket_listener_accept_socket)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<Socket> accept_socket(Glib::RefPtr<Glib::Object>& source_object, const Glib::RefPtr<Cancellable>& cancellable);
+#else
+Glib::RefPtr<Socket> accept_socket(Glib::RefPtr<Glib::Object>& source_object, const Glib::RefPtr<Cancellable>& cancellable, std::auto_ptr<Glib::Error>& error);
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+_WRAP_METHOD_DOCS_ONLY(g_socket_listener_accept_socket)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<Socket> accept_socket(Glib::RefPtr<Glib::Object>& source_object);
+#else
+Glib::RefPtr<Socket> accept_socket(Glib::RefPtr<Glib::Object>& source_object, std::auto_ptr<Glib::Error>& error);
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+_WRAP_METHOD_DOCS_ONLY(g_socket_listener_accept_socket)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<Socket> accept_socket(const Glib::RefPtr<Cancellable>& cancellable);
+#else
+Glib::RefPtr<Socket> accept_socket(const Glib::RefPtr<Cancellable>& cancellable, std::auto_ptr<Glib::Error>& error);
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+_WRAP_METHOD_DOCS_ONLY(g_socket_listener_accept_socket)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<Socket> accept_socket();
+#else
+Glib::RefPtr<Socket> accept_socket(std::auto_ptr<Glib::Error>& error);
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+
+_IGNORE(g_socket_listener_accept_socket_async)
+_WRAP_METHOD_DOCS_ONLY(g_socket_listener_accept_socket_async)
+void accept_socket_async(const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot);
+_WRAP_METHOD_DOCS_ONLY(g_socket_listener_accept_socket_async)
+void accept_socket_async(const SlotAsyncReady& slot);
+
+_IGNORE(g_socket_listener_accept_socket_finish)
+_WRAP_METHOD_DOCS_ONLY(g_socket_listener_accept_socket_finish)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<Socket> accept_socket_finish(const Glib::RefPtr<AsyncResult>& result, Glib::RefPtr<Glib::Object>& source_object);
+#else
+Glib::RefPtr<Socket> accept_socket_finish(const Glib::RefPtr<AsyncResult>& result, Glib::RefPtr<Glib::Object>& source_object, std::auto_ptr<Glib::Error>& error);
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+_WRAP_METHOD_DOCS_ONLY(g_socket_listener_accept_socket_finish)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<Socket> accept_socket_finish(const Glib::RefPtr<AsyncResult>& result);
+#else
+Glib::RefPtr<Socket> accept_socket_finish(const Glib::RefPtr<AsyncResult>& result, std::auto_ptr<Glib::Error>& error);
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+
+_IGNORE(g_socket_listener_accept)
+_WRAP_METHOD_DOCS_ONLY(g_socket_listener_accept)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<SocketConnection> accept(Glib::RefPtr<Object>& source_object, const Glib::RefPtr<Cancellable>& cancellable);
+#else
+Glib::RefPtr<SocketConnection> accept(Glib::RefPtr<Object>& source_object, const Glib::RefPtr<Cancellable>& cancellable, std::auto_ptr<Glib::Error>& error);
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+_WRAP_METHOD_DOCS_ONLY(g_socket_listener_accept)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<SocketConnection> accept(Glib::RefPtr<Object>& source_object);
+#else
+Glib::RefPtr<SocketConnection> accept(Glib::RefPtr<Object>& source_object, std::auto_ptr<Glib::Error>& error);
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+_WRAP_METHOD_DOCS_ONLY(g_socket_listener_accept)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<SocketConnection> accept(const Glib::RefPtr<Cancellable>& cancellable);
+#else
+Glib::RefPtr<SocketConnection> accept(const Glib::RefPtr<Cancellable>& cancellable, std::auto_ptr<Glib::Error>& error);
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+_WRAP_METHOD_DOCS_ONLY(g_socket_listener_accept)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<SocketConnection> accept();
+#else
+Glib::RefPtr<SocketConnection> accept(std::auto_ptr<Glib::Error>& error);
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+
+_WRAP_METHOD_DOCS_ONLY(g_socket_listener_accept_async)
+void accept_async(const SlotAsyncReady& slot);
+_WRAP_METHOD_DOCS_ONLY(g_socket_listener_accept_async)
+void accept_async(const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot);
+_IGNORE(g_socket_listener_accept_async)
+
+_WRAP_METHOD_DOCS_ONLY(g_socket_listener_accept_finish)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<SocketConnection> accept_finish(const Glib::RefPtr<AsyncResult>& result, Glib::RefPtr<Glib::Object>& source_object);
+#else
+Glib::RefPtr<SocketConnection> accept_finish(const Glib::RefPtr<AsyncResult>& result, Glib::RefPtr<Glib::Object>& source_object, std::auto_ptr<Glib::Error>& error);
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+_WRAP_METHOD_DOCS_ONLY(g_socket_listener_accept_finish)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Glib::RefPtr<SocketConnection> accept_finish(const Glib::RefPtr<AsyncResult>& result);
+#else
+Glib::RefPtr<SocketConnection> accept_finish(const Glib::RefPtr<AsyncResult>& result, std::auto_ptr<Glib::Error>& error);
+#endif // GLIBMM_EXCEPTIONS_ENABLED
+
+_WRAP_METHOD (void close(), g_socket_listener_close)
+
+};
+
+} // namespace Gio



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]