It is rediculous, and you're right, it should run.
Perhaps it's something external like port restrictions imposed by some firewall or something. Or maybe the port number is too low for a non-admin account. Just guessing ...
I suspect that it has something to do with the typecast of userPort. Narrowing conversions are a PITA, and an explicit cast is not a work around that you should use regularly. You should avoid them where ever you can.
Is there a reason that userPort HAS to be a 'sockaddr_in' instead of the smaller 'sockaddr? If it was a sockaddr from the beginning then casting the other way around is pretty much trouble free.
It is working now. I have no idea why. There was a Windows Update running in the background and the antivirus also. Probably one of theese blocked the outgoing connection.