split the connectionthread into receiverthread and senderthread