Socket disconnect detection