|
Socket& Socket::operator=(Socket&& other) { |
|
if (this != &other) { |
|
this->fd = other.fd; |
|
other.fd = -1; |
|
} |
|
return *this; |
|
} |
Si vos tenés algo de este estilo (poco probable si usan bien la API, pero no sabés quien y como van a usar tu API,deberías protegerlo del mal uso).
Socket skt, skt2;
skt2.connect("localhost", "2020");
skt2 = skt;
vas a leakear el file descriptor del skt2.