通过调用setsockopt函数
http://hi.baidu.com/qhh_2008/item/b3544b36d552dcd06c15e91b
http://www.360doc.com/content/12/0211/16/1317564_185797704.shtml