From: Mikko Rasa Date: Wed, 10 Aug 2011 15:12:04 +0000 (+0300) Subject: Rename SockAddr::from_sys to new_from_sys X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=7cc338af60428770d72279cbae11f6fe218d2dcd;p=libs%2Fnet.git Rename SockAddr::from_sys to new_from_sys --- diff --git a/source/datagramsocket.cpp b/source/datagramsocket.cpp index 32ecc23..d24ca4e 100644 --- a/source/datagramsocket.cpp +++ b/source/datagramsocket.cpp @@ -38,7 +38,7 @@ bool DatagramSocket::connect(const SockAddr &addr) delete local_addr; SockAddr::SysAddr lsa; getsockname(priv->handle, reinterpret_cast(&lsa.addr), &lsa.size); - local_addr = SockAddr::from_sys(lsa); + local_addr = SockAddr::new_from_sys(lsa); connected = true; @@ -91,7 +91,7 @@ unsigned DatagramSocket::recvfrom(char *buf, unsigned size, SockAddr *&from_addr } } - from_addr = SockAddr::from_sys(sa); + from_addr = SockAddr::new_from_sys(sa); return ret; } diff --git a/source/resolve.cpp b/source/resolve.cpp index 076fea0..8afe0fe 100644 --- a/source/resolve.cpp +++ b/source/resolve.cpp @@ -50,7 +50,7 @@ SockAddr *resolve(const string &s, Family family) const char *sptr = reinterpret_cast(res->ai_addr); char *dptr = reinterpret_cast(&sa.addr); copy(sptr, sptr+res->ai_addrlen, dptr); - SockAddr *addr = SockAddr::from_sys(sa); + SockAddr *addr = SockAddr::new_from_sys(sa); freeaddrinfo(res); return addr; } diff --git a/source/sockaddr.cpp b/source/sockaddr.cpp index 0d14dfd..9b41f81 100644 --- a/source/sockaddr.cpp +++ b/source/sockaddr.cpp @@ -8,7 +8,7 @@ using namespace std; namespace Msp { namespace Net { -SockAddr *SockAddr::from_sys(const SysAddr &sa) +SockAddr *SockAddr::new_from_sys(const SysAddr &sa) { switch(sa.addr.ss_family) { diff --git a/source/sockaddr.h b/source/sockaddr.h index bf75477..aad5e29 100644 --- a/source/sockaddr.h +++ b/source/sockaddr.h @@ -19,7 +19,7 @@ public: virtual SockAddr *copy() const = 0; - static SockAddr *from_sys(const SysAddr &); + static SockAddr *new_from_sys(const SysAddr &); virtual SysAddr to_sys() const = 0; virtual Family get_family() const = 0; diff --git a/source/socket.cpp b/source/socket.cpp index 2bfdecc..5af2b4f 100644 --- a/source/socket.cpp +++ b/source/socket.cpp @@ -49,7 +49,7 @@ Socket::Socket(const Private &p): SockAddr::SysAddr sa; getsockname(priv->handle, reinterpret_cast(&sa.addr), &sa.size); - local_addr = SockAddr::from_sys(sa); + local_addr = SockAddr::new_from_sys(sa); #ifdef WIN32 *priv->event = CreateEvent(0, false, false, 0); diff --git a/source/streamserversocket.cpp b/source/streamserversocket.cpp index 2809742..bbf91bc 100644 --- a/source/streamserversocket.cpp +++ b/source/streamserversocket.cpp @@ -43,7 +43,7 @@ StreamSocket *StreamServerSocket::accept() Private new_p; new_p.handle = ::accept(priv->handle, reinterpret_cast(&sa.addr), &sa.size); - RefPtr paddr = SockAddr::from_sys(sa); + RefPtr paddr = SockAddr::new_from_sys(sa); return new StreamSocket(new_p, *paddr); } diff --git a/source/streamsocket.cpp b/source/streamsocket.cpp index 7919ec4..8a26245 100644 --- a/source/streamsocket.cpp +++ b/source/streamsocket.cpp @@ -66,7 +66,7 @@ bool StreamSocket::connect(const SockAddr &addr) delete local_addr; SockAddr::SysAddr lsa; getsockname(priv->handle, reinterpret_cast(&lsa.addr), &lsa.size); - local_addr = SockAddr::from_sys(lsa); + local_addr = SockAddr::new_from_sys(lsa); if(err==0) {