Added support for two part shutdown of socket.