I'd like to invoke  PySocketModule_ImportModuleAndAPI function defined in socketmodule.h in my Python C-extension.
I had a similar problem and resolved it by:

Adding the Modules\ directory (from your Python source) to the C/C++ Additional Include Directories.
#include "socketmodule.h"

Don't know if this is the best solution, but it worked for me!
Is it possible to include socketmodule.h in Python C extensions?