SF542 SocketAddress() needs port-only constructor

This commit is contained in:
aleks-f
2012-12-11 21:39:20 -06:00
parent 1b14088283
commit 25ea8ba735
3 changed files with 14 additions and 7 deletions

View File

@@ -241,9 +241,6 @@ public:
static NetworkInterface forIndex(unsigned index); static NetworkInterface forIndex(unsigned index);
/// Returns the NetworkInterface for the given interface index. /// Returns the NetworkInterface for the given interface index.
/// If an index of 0 is specified, a NetworkInterface instance
/// representing the default interface (empty name and
/// wildcard address) is returned.
/// ///
/// Throws an InterfaceNotFoundException if an interface /// Throws an InterfaceNotFoundException if an interface
/// with the given index does not exist (or IPv6 is not /// with the given index does not exist (or IPv6 is not

View File

@@ -64,16 +64,20 @@ public:
/// Creates a wildcard (all zero) IPv4 SocketAddress. /// Creates a wildcard (all zero) IPv4 SocketAddress.
SocketAddress(const IPAddress& host, Poco::UInt16 port); SocketAddress(const IPAddress& host, Poco::UInt16 port);
/// Creates a SocketAddress from an IP address and a port number. /// Creates a SocketAddress from an IP address and given port number.
SocketAddress(Poco::UInt16 port);
/// Creates a SocketAddress with unspecified (wildcard) IP address
/// and given port number.
SocketAddress(const std::string& host, Poco::UInt16 port); SocketAddress(const std::string& host, Poco::UInt16 port);
/// Creates a SocketAddress from an IP address and a port number. /// Creates a SocketAddress from an IP address and given port number.
/// ///
/// The IP address must either be a domain name, or it must /// The IP address must either be a domain name, or it must
/// be in dotted decimal (IPv4) or hex string (IPv6) format. /// be in dotted decimal (IPv4) or hex string (IPv6) format.
SocketAddress(const std::string& host, const std::string& port); SocketAddress(const std::string& host, const std::string& port);
/// Creates a SocketAddress from an IP address and a /// Creates a SocketAddress from an IP address and the
/// service name or port number. /// service name or port number.
/// ///
/// The IP address must either be a domain name, or it must /// The IP address must either be a domain name, or it must
@@ -83,7 +87,7 @@ public:
/// a service name. /// a service name.
explicit SocketAddress(const std::string& hostAndPort); explicit SocketAddress(const std::string& hostAndPort);
/// Creates a SocketAddress from an IP address or host name and a /// Creates a SocketAddress from an IP address or host name and the
/// port number/service name. Host name/address and port number must /// port number/service name. Host name/address and port number must
/// be separated by a colon. In case of an IPv6 address, /// be separated by a colon. In case of an IPv6 address,
/// the address part must be enclosed in brackets. /// the address part must be enclosed in brackets.

View File

@@ -233,6 +233,12 @@ SocketAddress::SocketAddress(const IPAddress& addr, Poco::UInt16 port)
} }
SocketAddress::SocketAddress(Poco::UInt16 port)
{
init(IPAddress(), port);
}
SocketAddress::SocketAddress(const std::string& addr, Poco::UInt16 port) SocketAddress::SocketAddress(const std::string& addr, Poco::UInt16 port)
{ {
init(addr, port); init(addr, port);