Currently, each program node opens its own socket to the remote machine. While on a connection and timing perspective this isn't ideal, that saves us from matching the content received through the socket with the program nodes currently being active.
We would then have to match incoming messages to the individual program nodes.
Alternatively we could open the socket at the beginning and make the program nodes responsible for reading from the socket. The problem with that would be that there might be messages coming out from the socket not meant for that particular program node. This will get especially messy once there might be program nodes running in a separate thread.
Currently, each program node opens its own socket to the remote machine. While on a connection and timing perspective this isn't ideal, that saves us from matching the content received through the socket with the program nodes currently being active.
We would then have to match incoming messages to the individual program nodes.
Alternatively we could open the socket at the beginning and make the program nodes responsible for reading from the socket. The problem with that would be that there might be messages coming out from the socket not meant for that particular program node. This will get especially messy once there might be program nodes running in a separate thread.