The program contains;
pc.printf("IP Address is %s\n\r", eth.getIPAddress());
pc.puts("\r\nWait for new connection...\n\r");
int n = socket.receive(buffer, 1);
All works OK but the socket.receive waits until a char to arrive, this locks up my program.
Is there a way to know upfront that the buffer contains a character?? then i can prevent the locking up.
Hi Garrit -
Have you read about blocking and non-blocking on the Sockets page? There is also some explanation about this function in the comments on that page, specifically from Emilio on August 8, 2012.
You have blocking set to TRUE in your code above, so it will wait forever. You could set it to FALSE and give it a timeout value.
I hope that helps,
Thanks for your info,I will give it a shot and see what happens.
It works like a charm.
Thank you very very much
Please log in to post a reply.
mbed, the fastest way to prototype with ARM based microcontrollers.
^ back to top