fixed monkey-patching breaking for non-socket connections