summaryrefslogtreecommitdiff
path: root/gio/src/srvtarget.hg
blob: 2372b937576f51a9fa7fff20c66eb7e25466b90e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* Copyright (C) 2009 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, see <http://www.gnu.org/licenses/>.
 */

_CONFIGINCLUDE(giommconfig.h)

#include <glibmm/value.h>

_DEFS(giomm,gio)

namespace Gio
{

/** DNS SRV record target
 *
 * SRV (service) records are used by some network protocols to provide
 * service-specific aliasing and load-balancing. For example, XMPP (Jabber) uses
 * SRV records to locate the XMPP server for a domain; rather than connecting
 * directly to "example.com" or assuming a specific server hostname like
 * "xmpp.example.com", an XMPP client would look up the "xmpp-client" SRV record
 * for "example.com", and then connect to whatever host was pointed to by that
 * record.
 *
 * You can use Resolver::lookup_service() or Resolver::lookup_service_async()
 * to find the SrvTargets for a given service. However, if you are simply
 * planning to connect to the remote service, you can use NetworkService's
 * SocketConnectable interface and not need to worry about SrvTarget at all.
 *
 * @newin{2,24}
 * @ingroup NetworkIO
 */
class GIOMM_API SrvTarget
{
  _CLASS_BOXEDTYPE(SrvTarget, GSrvTarget, NONE, g_srv_target_copy, g_srv_target_free, GIOMM_API)
public:
  SrvTarget(const Glib::ustring& hostname, guint16 port, guint16 priority, guint16 weight);

  _IGNORE(g_srv_target_copy, g_srv_target_free)

  _WRAP_METHOD(Glib::ustring get_hostname() const, g_srv_target_get_hostname)
  _WRAP_METHOD(guint16 get_port() const, g_srv_target_get_port)
  _WRAP_METHOD(guint16 get_priority() const, g_srv_target_get_priority)
  _WRAP_METHOD(guint16 get_weight() const, g_srv_target_get_weight)

};


} // namespace Gio