Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

istream& operator>> ( istream &  s,
PIPSocket::Address a 
) [friend]

input IPv4 (not IPv6 yet!) address as a string from the specified string

Not IPv6 ready !!!!!!!!!!!!!

Definition at line 2495 of file sockets.cxx.

{
/// Not IPv6 ready !!!!!!!!!!!!!
  char dot1, dot2, dot3;
  unsigned b1, b2, b3, b4;
  s >> b1;
  if (!s.fail()) {
    if (s.peek() != '.')
      a = htonl(b1);
    else {
      s >> dot1 >> b2 >> dot2 >> b3 >> dot3 >> b4;
      if (!s.fail() && dot1 == '.' && dot2 == '.' && dot3 == '.')
        a = PIPSocket::Address((BYTE)b1, (BYTE)b2, (BYTE)b3, (BYTE)b4);
    }
  }
  return s;
}


Generated by  Doxygen 1.6.0   Back to index