use transmit() and receive() during handshake instead of manual
implementation