@Override protected void doRun() { connectToVideoDataPort(); initializeCommunication(); setReady(); while (!isStopped()) { try { udpComponent.receive(incomingDataPacket); processData(); udpComponent.sendKeepAlivePacket(); } catch (RuntimeException e) { // This happens sometimes, but does not hinder the video data from being displayed } } disconnectFromVideoDataPort(); }
private void initializeCommunication() { udpComponent.sendKeepAlivePacket(); sleep(1000); }