sometimes $sockname results to a different socket, if you have multiple running with similar names. Tested, and i had to change my whole script to compensate.