handling handshake in buddy, handling messages in buddy