Devi usare un altro thread dove far eseguire il tuo codice che riceve.