Is the memory constraint only on the devices or also on the central PC/control panel?
If it's only on the devices I would recommend the following:
Use the PC as central node communicating with all the devices and dispatching communication between them. On the nodes, only connect to the central broker, this way you only need to manage a single connection instead of n. Additionally use a lightweight protocol. MQTT was developed pretty much for that purpose. If you want something custom you can go with raw TCP or, if you need it even more leightweight, raw UDP.
Also if you need have a really slim footprint, use the raw berkley API instead of some fat OOP library (like Indy, Synapse or even ssockets), and do single threaded networking. But these are rather extreme measures.