Permalink
Browse files

SF542 SocketAddress() needs port-only constructor

  • Loading branch information...
1 parent 1b14088 commit 25ea8ba735a6b4ad9ab608aeab3388dc904a7387 @aleks-f aleks-f committed Dec 12, 2012
Showing with 14 additions and 7 deletions.
  1. +0 −3 Net/include/Poco/Net/NetworkInterface.h
  2. +8 −4 Net/include/Poco/Net/SocketAddress.h
  3. +6 −0 Net/src/SocketAddress.cpp
@@ -241,9 +241,6 @@ class Net_API NetworkInterface
static NetworkInterface forIndex(unsigned 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
/// with the given index does not exist (or IPv6 is not
@@ -64,16 +64,20 @@ class Net_API SocketAddress
/// Creates a wildcard (all zero) IPv4 SocketAddress.
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);
- /// 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
/// be in dotted decimal (IPv4) or hex string (IPv6) format.
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.
///
/// The IP address must either be a domain name, or it must
@@ -83,7 +87,7 @@ class Net_API SocketAddress
/// a service name.
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
/// be separated by a colon. In case of an IPv6 address,
/// the address part must be enclosed in brackets.
@@ -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)
{
init(addr, port);

0 comments on commit 25ea8ba

Please sign in to comment.