Correct, hard to use TCP for 500K connections for a quick test when there are only 64K source ports which suffer from TIME_WAIT issues as bonus. It uses Unix Stream sockets.
Can you distribute your connections across 127.0.0.1, 127.0.0.2, 127.0.0.3, etc.? You've got the whole class A reserved as the loopback which should give you plenty of ports to work with.