function [bytesReceived] = receiver(portnumber)

persistent udpRx

if isempty(udpRx) 
    udpRx = dsp.UDPReceiver('MessageDataType','double'); 
end 

udpRx.LocalIPPort = portnumber; 
dataReceived = udpRx();
bytesReceived = length(dataReceived);

