Fixed issue with send_handshake.
Using close method instead of send it by hand.