Clean up socket related interfaces.

Author:yangyingchao, 2013-01-23