Added handling of manual raw socket disconnect.