@Override
    public void run() {

        try {
            packet = receivePacket();
            stdOut.writeln(TAG + " received packet is: " + packet);
        } catch (Exception e) {
            stdOut.printError(e.getMessage());
            cancelOnReceiveError();
            return;
        }

        if (initiatorIsMe()) {
            packetBackToInitiator();
        } else {
            moveMyNodeToVisited();

            if (isMyNodeOnlyTransport()) {
                send();
            } else if (isResendImmediately()) {
                send();
                performAction();
            } else {
                performAction();
                send();
            }

        }
        stdOut.writeln(TAG + " packet after its processing: " + packet);
        stdOut.writeln(TAG + " connection ended");

    }