Hi,
this is a very good question, and not an easy one too. The problem is that you can't change a socket's attribute before it is created, and you want to change it before it is used too. Moreover, sockets are created at run-time, and (usually) as soon as they're created they do start connecting, and when they do it it's too late to change MaxWindowSize.
The ConfigStore can save your day, as it can both dump all the attributes (not just the default ones) into a file, and read from it too.
The. process is: add ConfigStore to your script and dump all the attributes to a file. Find the attributes you want to change (look at ids of the nodes and the sockets), then change them. Load back the config to your script and run it.
Alternatively, you can use Config::Set((char*)path, StringValue((char*)value));, but you'll need to find the right path pointing at the sockets, and the easiest way is though ConfigStore