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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Class Poco::Net::SocketAddress</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="language" content="en"/>
<meta name="date" content="2009-11-24"/>
<meta name="generator" content="PocoDoc"/>
<link rel="stylesheet" href="css/styles.css" type="text/css"/>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<div class="header">
<h1 class="namespace"><a href="Poco.Net.html" class="namespace">Poco::Net</a></h1>
<h1 class="symbol">class SocketAddress</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Net<br />
<b>Package:</b> NetCore<br />
<b>Header:</b> Poco/Net/SocketAddress.h</p>
<h2>Description</h2>
<div class="description">
<p>This class represents an internet (IP) endpoint/socket address. The address can belong either to the IPv4 or the IPv6 address family and consists of a host address and a port number. </p>
</div>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.Net.SocketAddress.html#15135" title="Poco::Net::SocketAddress::addr()">addr</a>, <a href="Poco.Net.SocketAddress.html#15136" title="Poco::Net::SocketAddress::af()">af</a>, <a href="Poco.Net.SocketAddress.html#15138" title="Poco::Net::SocketAddress::family()">family</a>, <a href="Poco.Net.SocketAddress.html#15132" title="Poco::Net::SocketAddress::host()">host</a>, <a href="Poco.Net.SocketAddress.html#15141" title="Poco::Net::SocketAddress::init()">init</a>, <a href="Poco.Net.SocketAddress.html#15134" title="Poco::Net::SocketAddress::length()">length</a>, <a href="Poco.Net.SocketAddress.html#15128" title="Poco::Net::SocketAddress::operator =()">operator =</a>, <a href="Poco.Net.SocketAddress.html#15133" title="Poco::Net::SocketAddress::port()">port</a>, <a href="Poco.Net.SocketAddress.html#15147" title="Poco::Net::SocketAddress::resolveService()">resolveService</a>, <a href="Poco.Net.SocketAddress.html#15130" title="Poco::Net::SocketAddress::swap()">swap</a>, <a href="Poco.Net.SocketAddress.html#15137" title="Poco::Net::SocketAddress::toString()">toString</a></p>
<h2>Enumerations</h2>
<h3><i>Anonymous</i></h3>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="15140">MAX_ADDRESS_LENGTH</a> = sizeof (struct sockaddr_in)</p>
<div class="description">
<p>Maximum length in bytes of a socket address. </p>
</div>
<h2>Constructors</h2>
<h3><a name="15110">SocketAddress</a></h3>
<p class="decl"><a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a>();</p>
<div class="description">
<p>Creates a wildcard (all zero) IPv4 <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a>. </p>
</div>
<h3><a name="15120">SocketAddress</a></h3>
<p class="decl">explicit <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a>(<br /> const std::string & hostAndPort<br />);</p>
<div class="description">
<p>Creates a <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> from an IP address or host name and a port number/service name. Host name/address and port number must be separated by a colon. In case of an IPv6 address, the address part must be enclosed in brackets. </p>
<p>Examples: </p>
<pre>192.168.1.10:80
[::FFFF:192.168.1.120]:2040
www.appinf.com:8080
</pre>
</div>
<h3><a name="15122">SocketAddress</a></h3>
<p class="decl"><a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a>(<br /> const <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> & addr<br />);</p>
<div class="description">
<p>Creates a <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> by copying another one. </p>
</div>
<h3><a name="15111">SocketAddress</a></h3>
<p class="decl"><a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a>(<br /> const <a href="Poco.Net.IPAddress.html" title="class Poco::Net::IPAddress">IPAddress</a> & host,<br /> <a href="Poco.html#11352" title="Poco::UInt16">Poco::UInt16</a> port<br />);</p>
<div class="description">
<p>Creates a <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> from an IP address and a port number. </p>
</div>
<h3><a name="15114">SocketAddress</a></h3>
<p class="decl"><a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a>(<br /> const std::string & host,<br /> <a href="Poco.html#11352" title="Poco::UInt16">Poco::UInt16</a> port<br />);</p>
<div class="description">
<p>Creates a <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> from an IP address and a port number. </p>
<p>The IP address must either be a domain name, or it must be in dotted decimal (IPv4) or hex string (IPv6) format. </p>
</div>
<h3><a name="15117">SocketAddress</a></h3>
<p class="decl"><a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a>(<br /> const std::string & host,<br /> const std::string & port<br />);</p>
<div class="description">
<p>Creates a <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> from an IP address and a service name or port number. </p>
<p>The IP address must either be a domain name, or it must be in dotted decimal (IPv4) or hex string (IPv6) format. </p>
<p>The given port must either be a decimal port number, or a service name. </p>
</div>
<h3><a name="15124">SocketAddress</a></h3>
<p class="decl"><a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a>(<br /> const struct sockaddr * addr,<br /> socklen_t length<br />);</p>
<div class="description">
<p>Creates a <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> from a native socket address. </p>
</div>
<h2>Destructor</h2>
<h3><a name="15127">~SocketAddress</a></h3>
<p class="decl">~<a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a>();</p>
<div class="description">
<p>Destroys the <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a>. </p>
</div>
<h2>Member Functions</h2>
<h3><a name="15135">addr</a></h3>
<p class="decl">const struct sockaddr * addr() const;</p>
<div class="description">
<p>Returns a pointer to the internal native socket address. </p>
</div>
<h3><a name="15136">af</a></h3>
<p class="decl">int af() const;</p>
<div class="description">
<p>Returns the address family (AF_INET or AF_INET6) of the address. </p>
</div>
<h3><a name="15138">family</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Net.IPAddress.html#13594" title="enum Poco::Net::IPAddress::Family">IPAddress::Family</a> family() const;</p>
<div class="description">
<p>Returns the address family of the host's address. </p>
</div>
<h3><a name="15132">host</a></h3>
<p class="decl"><a href="Poco.Net.IPAddress.html" title="class Poco::Net::IPAddress">IPAddress</a> host() const;</p>
<div class="description">
<p>Returns the host IP address. </p>
</div>
<h3><a name="15134">length</a></h3>
<p class="decl">socklen_t length() const;</p>
<div class="description">
<p>Returns the length of the internal native socket address. </p>
</div>
<h3><a name="15128">operator =</a></h3>
<p class="decl"><a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> & operator = (<br /> const <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> & addr<br />);</p>
<div class="description">
<p>Assigns another <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a>. </p>
</div>
<h3><a name="15133">port</a></h3>
<p class="decl"><a href="Poco.html#11352" title="Poco::UInt16">Poco::UInt16</a> port() const;</p>
<div class="description">
<p>Returns the port number. </p>
</div>
<h3><a name="15130">swap</a></h3>
<p class="decl">void swap(<br /> <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> & addr<br />);</p>
<div class="description">
<p>Swaps the <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> with another one. </p>
</div>
<h3><a name="15137">toString</a></h3>
<p class="decl">std::string toString() const;</p>
<div class="description">
<p>Returns a string representation of the address. </p>
</div>
<h3><a name="15141">init</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void init(<br /> const <a href="Poco.Net.IPAddress.html" title="class Poco::Net::IPAddress">IPAddress</a> & host,<br /> <a href="Poco.html#11352" title="Poco::UInt16">Poco::UInt16</a> port<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="15144">init</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void init(<br /> const std::string & host,<br /> <a href="Poco.html#11352" title="Poco::UInt16">Poco::UInt16</a> port<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="15147">resolveService</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.html#11352" title="Poco::UInt16">Poco::UInt16</a> resolveService(<br /> const std::string & service<br />);</p>
<div class="description">
<p></p>
</div>
<p class="footer">POCO C++ Libraries 1.3.6-all<br />
Copyright © 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>
</div>
</body>
</html>
|