Do you have com locked? Check options > other > lock

What you're describing doesn't really make sense though, can you provide the code? You can open a socket in loop, but no action will be taken on it until the loop is done.