Ned Batchelder had an interesting post recently about finding temp file creators through monkey-patching[0]. I could see a similar approach being helpful here by patching the socket module to find all call stacks.
[0]: http://nedbatchelder.com/blog/201503/finding_temp_file_creat...