Permalink
Browse files

Use SocketAddress to get sockaddr instead.

  • Loading branch information...
pprindeville committed Dec 26, 2012
1 parent 68c8eee commit 2f6be752039895ff2163407640247b12471b1fb4
Showing with 9 additions and 0 deletions.
  1. +9 −0 Net/include/Poco/Net/SocketAddress.h
@@ -137,6 +137,9 @@ class Net_API SocketAddress
bool operator == (const SocketAddress& addr) const;
bool operator != (const SocketAddress& addr) const;
+ operator const struct sockaddr& () const;
+ /// Typecast to a struct sockaddr reference.
+
enum
{
MAX_ADDRESS_LENGTH =
@@ -185,6 +188,12 @@ inline bool SocketAddress::operator != (const SocketAddress& addr) const
}
+inline SocketAddress::operator const struct sockaddr& () const
+{
+ return *(addr());
+}
+
+
} } // namespace Poco::Net

0 comments on commit 2f6be75

Please sign in to comment.