namespace Net {
ClientSocket::ClientSocket(Family af, int type, int proto):
- Socket(af, type, proto),
- connecting(false),
- connected(false),
- peer_addr(0)
+ Socket(af, type, proto)
{ }
ClientSocket::ClientSocket(const Private &p, const SockAddr &paddr):
Socket(p),
- connecting(false),
connected(true),
peer_addr(paddr.copy())
{ }
const SockAddr &ClientSocket::get_peer_address() const
{
- if(peer_addr==0)
+ if(!peer_addr)
throw bad_socket_state("not connected");
return *peer_addr;
}