Permalink
Browse files

Revert sockaddr typecast method.

  • Loading branch information...
1 parent 3d7367e commit 68c8eee38057e2d8395711202f280de0226488ac @pprindeville committed Dec 26, 2012
Showing with 0 additions and 25 deletions.
  1. +0 −3 Net/include/Poco/Net/IPAddress.h
  2. +0 −22 Net/src/IPAddress.cpp
@@ -324,9 +324,6 @@ class Net_API IPAddress
IPAddress operator ^ (const IPAddress& addr) const;
IPAddress operator ~ () const;
- operator const sockaddr () const;
- /// cast to sockaddr
-
poco_socklen_t length() const;
/// Returns the length in bytes of the internal socket address structure.
View
@@ -1167,28 +1167,6 @@ IPAddress IPAddress::operator ~ () const
}
-IPAddress::operator const sockaddr () const
-{
- sockaddr sock;
-
- memset(&sock, 0, sizeof(sock));
-
- sock.sa_family = af();
- if (sock.sa_family == AF_INET) {
- poco_set_sin_len((sockaddr_in *)&sock);
- memcpy(&((struct sockaddr_in *)&sock)->sin_addr, addr(), sizeof(in_addr));
-#if defined(POCO_HAVE_IPv6)
- } else {
- poco_set_sin6_len((sockaddr_in6 *)&sock);
- memcpy(&((sockaddr_in6 *)&sock)->sin6_addr, addr(), sizeof(in6_addr));
- ((sockaddr_in6 *)&sock)->sin6_scope_id = scope();
-#endif
- }
-
- return sock;
-}
-
-
poco_socklen_t IPAddress::length() const
{
return _pImpl->length();

0 comments on commit 68c8eee

Please sign in to comment.