As suggested, your network class should run in a working thread, while the
GUI
runs in the main one, see the following
Newcomer's article:
"WorkerThreads"[
^] (you may find a lot of useful assays in his webpage).
You may use, for instance, properly synchronized shared resources to hold incoming and outcoming data and messages (via, for instance,
PostMessage
) to make the network class notifying for data arrival.