1/* Copyright (C) 2009 jonathon jongsma 2 * 3 * This library is free software; you can redistribute it and/or 4 * modify it under the terms of the GNU Lesser General Public 5 * License as published by the Free Software Foundation; either 6 * version 2.1 of the License, or (at your option) any later version. 7 * 8 * This library is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * Lesser General Public License for more details. 12 * 13 * You should have received a copy of the GNU Lesser General Public 14 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 15 */ 16 17#include <giomm/socketaddress.h> 18#include <giomm/inetaddress.h> 19#include <giomm/enums.h> 20 21_DEFS(giomm,gio) 22_PINCLUDE(giomm/private/socketaddress_p.h) 23 24namespace Gio 25{ 26 27/** Internet SocketAddress 28 * 29 * An IPv4 or IPv6 socket address; that is, the combination of a 30 * InetAddress and a port number. 31 * 32 * An IPv4 or IPv6 socket address, corresponding to a struct sockaddr_in or 33 * struct sockaddr_in6. 34 * 35 * @newin{2,24} 36 * @ingroup NetworkIO 37 */ 38class GIOMM_API InetSocketAddress 39: public SocketAddress 40{ 41 _CLASS_GOBJECT(InetSocketAddress, GInetSocketAddress, G_INET_SOCKET_ADDRESS, SocketAddress, GSocketAddress, , , GIOMM_API) 42 43protected: 44 _WRAP_CTOR(InetSocketAddress(const Glib::RefPtr<InetAddress>& address, guint16 port), g_inet_socket_address_new) 45 46public: 47 _WRAP_CREATE(const Glib::RefPtr<InetAddress>& address, guint16 port) 48 49 _WRAP_METHOD(Glib::RefPtr<InetAddress> get_address(), g_inet_socket_address_get_address, refreturn) 50 _WRAP_METHOD(Glib::RefPtr<const InetAddress> get_address() const, g_inet_socket_address_get_address, refreturn, constversion) 51 52 _WRAP_METHOD(guint16 get_port() const, g_inet_socket_address_get_port) 53 54 _WRAP_METHOD(guint32 get_flowinfo() const, g_inet_socket_address_get_flowinfo) 55 _WRAP_METHOD(guint32 get_scope_id() const, g_inet_socket_address_get_scope_id) 56 57 _WRAP_PROPERTY("address", Glib::RefPtr<InetAddress>) 58 _WRAP_PROPERTY("port", guint16) 59 _WRAP_PROPERTY("flowinfo", guint32) 60 _WRAP_PROPERTY("scope-id", guint32) 61}; 62 63} // namespace Gio 64