Unix Network Programming, Volume 1

Unix Network Programming, Volume 1

作者:[美国]W·RichardStevens

出版社:Addison-Wesley Professional

出版年:2003-11

评分:9.6

ISBN:9780131411555

所属分类:行业好书

书刊介绍

内容简介

This is THE guide to UNIX network programming APIs. Whether you write Web servers, client/server applications, or any other network software, you need to understand networking APIS-especially sockets in greater detail than ever before. You need UNIX Network Programming, Volume 1, Third Edition. In this book, the Authors offer unprecedented, start-to-finish guidance on making the most of sockets, the de facto standard for UNIX network programming with APIs - as well as extensive coverage of the X/Open Transport Interface (XTI).

精彩摘录

TherearetworeasonsfortheTIME_WAITstate:1.ToimplementTCP'sfull-duplexconnectionterminationreliably.2.Toallowoldduplicatesegmentstoexpireinthenetwork.

——引自第64页


既然发生错误时终止程序的运行是普遍的情况,我们可以定义包裹函数(wrapperfunction)来简化我们的程序。包裹函数调用实际函数,检查返回值,并在发生错误时终止进程。intSocket(intfamily,inttype,intprotocol){intn;if((n=socket(family,type,protocol))<0)err_sys("socketerror");return(n);}

——引自第10页

相关推荐

微信二维码