1- i know that the udp server needs to specify its input(receiving) port
2- so when i initialize the server socket i write
udpA = udp('LocalPort',7070);
there is an error:
Unsuccessful open: Unknown RemoteHost: LocalPort.
i know that i shouldnot put the client id or port when initializing the server socket , because when the client intiates the communication ,it will automatically send its ip and port numbers to the server , so the server can send back to the client if needed
here is my code for the server:
udpA = udp('LocalPort',7070);
udpA.EnablePortSharing = 'on';
fopen(udpA)
if (udpA.BytesAvailable>0)
x = fread(udpA,udpA.BytesAvailable);
fprintf(udpA,'ok');
end