5 years, 3 months ago.

Run socket concurrently with other code?

I am utilizing TCPEchoServer example code to build a ethernet commanded system.

How do I continuously monitor for a connection while running other code?

Ideally it would be something like:

Check for connection if connected: read buffer, execute parse else: run rest of program

I want to avoid threads and RTOS features for now.

My thoughts are that an interrupt could be used, but calling "TCPSocketConnection client;" stops the program until a connection has occurred. I have attempted to review the code and documentation however, I do not understand how this is instantiated (why it's blocking further execution).

Can anyone provide some more depth into how this should be done.

Also, could someone explain what part of the TCPSocketConnection e.g. codeline is responsible for the block?

Thanks kindly!

Be the first to answer this question.