Blocking or non blocking communication
I need to communicate to several devices over TCP In my design. My concept is event driven system in C++ with Embarcadero studio. For exmape I would like to detect all devices are ready and then continue with initializing. In event driven system means that there is “callbacks” from TcpConnect in each device object. Then I must periodically (timer) testing some flag from each callback and when all are set I can say: OK it is ready and I can continue in my code for example to initialization. In blocking approach it seems to be easier. I can call TcpConnct() method for each device and wait for them. I think it is much easier (code is good readable and no checking) than event driven case. Advantage of ED case is connection can run simultaneously and it could be faster. My question is very general I know. But what concept is good, preferable, or what condition is important to choose one or other.