change #ifdef SIMULATOR to #ifdef SO_NONBLOCKING to disable socket conblocking code on all platforms with dont support it (like linux)