Working Handshake Protocol Implementation in Peer.cpp