For good proper redundancy you might try selecting a wide range of port numbers. So your app will listen on port 2000, 2100, 2200, 2250, 2260, 2270, 2280, 2290, 2295, 2300

Chances are at least one should be free. And when another app is trying to connect, if it doesn't receive the correct handshake protocol upon connect, then that's another app already running on that computer...