第一步:首先下载本书配套的源代码unpv13e.tar.gz
第二步:解压后进入根目录有一个README
4 Execute the following from the src/ directory:
5
6 ./configure # try to figure out all implementation differences
7
8 cd lib # build the basic library that all programs need
9 make # use "gmake" everywhere on BSD/OS systems
10
11 cd ../libfree # continue building the basic library
12 make
13
14 cd ../libroute # only if your system supports 4.4BSD style routing sockets
15 make # only if your system supports 4.4BSD style routing sockets
16
17 cd ../libxti # only if your system supports XTI
18 make # only if your system supports XTI
19
20 cd ../intro # build and test a basic client program
21 make daytimetcpcli
22 ./daytimetcpcli 127.0.0.1
23
24 If all that works, you're all set to start compiling individual programs.
第三步:因为我的是ubuntu,因此执行上面的6 8 9 11 12
即在根目录下执行
./configure
然后
cd lib
make
在进入libfree 执行make
cd ../libfree
make
第四步(很重要):
cp ./lib/unp.h /usr/include/
cp ./config.h /usr/include/
然后进入intro编译第一个程序即可
cd ../intro
make daytimetcpcli
./daytimetcpcli 127.0.0.1
发现报错:connect error: Connection refused
这种情况说明服务器没有启动daytime服务!
第五步:
启动daytime服务
sudo apt-get install xinetd
sudo vi /etc/xinetd.d/daytime 将disable =yes改为no
然后重启并运行程序即可看到结果:
/etc/init.d/xinetd restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service xinetd restart
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) and then start(8) utilities,
e.g. stop xinetd ; start xinetd. The restart(8) utility is also available.
xinetd stop/waiting
xinetd start/running, process 21975
root@wl-Lenovo-B590:/myworkspace/unixnetwork/unpv13e/intro# ./daytimetcpcli 127.0.0.1
18 APR 2014 14:03:08 CST
分享到:
相关推荐
Unix网络编程(第三版)源码 网络编程,源代码,
unix网络编程第一卷的源码,是官方未改变版本的
绝好的UNIX网络编程第三版英文+源码。 书是chm版本的。 代码都已经列出来,方便读者查阅调试。 希望对大家有帮助
unix网络编程 第三版源码,配合对应书籍一块儿学习使用。
《UNIX网络编程》(第1卷)(套接口API第3版)第1版和第2版由已故UNIX网络专家W. Richard Stevens博士独自编写。《UNIX网络编程》(第1卷)(套接口API第3版)是3版,由世界著名网络专家Bill Fenner和Andrew M. Rudoff执笔,...
Unix网络编程第三版代码,真的,Unix网络编程第三版代码,真的
Unix环境高级编程第三版源码与源码配置说明。网上的好多配置说明实际操作起来都会好脆县这样那样的问题,而这里的配置说明是亲自尝试ok的。
W. Richard Stevens的经典书籍,UNIX网络编程第三版英文(chm)+源码
UNIX网络编程 卷1 中文版 PDF高清带索引 附带源码 By W. Richard Stevens, Bill Fenner, Andrew M. Rudoff
《UNIX网络编程 卷1:套接字联网API(第2版)》是一部UNIX网络编程的经典之作。书中全面深入地介绍了如何使用套接字API进行网络编程。全书不但介绍了基本编程内容,还涵盖了与套接字编程相关的高级主题,对于客户/...
UNIX网络编程卷1(第三版 英文版).pdf
UNIX网络编程卷一:套接口编程的全套源码!是学习UNIX/LINUX网络编程的经典资料!
UNIX环境高级编程(第2版)-中文.pdf 带目录 UNIX环境高级编程(第3版)-中文-mobi转换.pdf 带目录 UNIX环境高级编程(第3版)-中文.pdf 带目录 UNIX环境高级编程(第3版)-英文版.pdf 带目录 UNIX环境高级编程中文版-文字版...
UNIX网络编程卷1,高清版,带书签。
unix网络编程卷1第三版英文版 unix网络编程卷1第三版英文版 unix网络编程卷1第三版英文版 unix网络编程卷1第三版英文版 unix网络编程卷1第三版英文版 unix网络编程卷1第三版英文版 unix网络编程卷1第三版英文版
UNIX网络编程第三版卷1英文chm+源码.7zUNIX网络编程第三版卷1英文chm+源码.7z
UNIX网络编程----进程间通信----卷2【第二版】源码
unix网络编程v1第三版随书源码.tar,下载源码的官网打不开了,网上很多版本都是.rar格式,不能再linux上解压。该文件的格式是tar。解压方法:tar xvf unpv13e.tar
UNIX网络编程第三版英文版卷1,2合集
UNIX网络编程(第2版)第1卷_套接口API和XOpen.传输接口API