Revert "delete code to set SO_LINGER option"

This reverts commit da7aed7451722f9577b5ae32a58cd55db3918748.
delete code to set SO_LINGER option