Internet security blocking a port

Hello!

I need help setting up my AVAST Internet Security to allow communication between two programs I’m working on.

I have added them to the exception list in settings>antivirus>esclusions, but this seems to be more firewall related.
I’m rather sure my firewall rules are set correctly but I guess it’s worth a check.
What I know for sure, if I disable avast protections the two programs can communicate nicely. BUT avast disables the windows firewall as well so perhaps I should be looking there.

Any hints?

Additional note: I have disabled Windows Firewall from the control panel, but the two programs cannot communicate anyway so I’m inclined to believe this is due to Avast.

I don’t remember having this difficulty previously.

Update.

I’ve noticed a pattern. If I connect to my own computer, the first connection attempt always fails, while the second succeeds.

If I try to connect to a remote server, it always fails.

I have tried fiddling a bit with the firewall settings with no success.

As it stands now, I have to disable avast completely to continue. This is not viable. I need help in configuring avast to allow my program run with no restrictions.