How are you invoking the script? If you are calling the script via a web browser or a simulated web browser (like wget, lwp, or even PHP's fopen), then what happens when you call the script via the other IP?
For instance, let's say your two IP's are 1.1.1.1 and 2.2.2.2
and you have a php script called connect.php that opens a socket.
What happens when you call http://1.1.1.1/connect.php versus http://2.2.2.2/connect.php
And if that works but you don't want numbers in your domain names, you can have two host names each resolving to a different IP. (ie. www.xxx.com = 1.1.1.1 and www2.xxx.com = 2.2.2.2)
And lastly, if you never wanted the user (or Google) to see you using alternate domain names, you could have Ajax on the client side or a PHP script on the server side calling the fsocket script on the other IP address.