Clarified purpose of setTimeout and upped value to 30s from 5. A low value here will cause many repeated tcp open/close in low traffic situations.