博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
unix网络编程第三版源代码ubuntu下配置的问题解决
阅读量:4344 次
发布时间:2019-06-07

本文共 1950 字,大约阅读时间需要 6 分钟。

第一步:首先下载本书配套的源码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
这样的情况说明server没有启动daytime服务!

第五步:

启动daytime服务

sudo apt-get install xinetd
sudo vi /etc/xinetd.d/daytime 将disable =yes改为no
然后重新启动并执行程序就可以看到结果:

/etc/init.d/xinetd restartRather than invoking init scripts through /etc/init.d, use the service(8)utility, e.g. service xinetd restartSince the script you are attempting to invoke has been converted to anUpstart 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/waitingxinetd start/running, process 21975root@wl-Lenovo-B590:/myworkspace/unixnetwork/unpv13e/intro# ./daytimetcpcli 127.0.0.118 APR 2014 14:03:08 CST

转载于:https://www.cnblogs.com/mengfanrong/p/5249502.html

你可能感兴趣的文章
下游系统访问思考
查看>>
TreeView绑定数据库数据
查看>>
StringTokenizer
查看>>
移动互联网产品设计的核心要素有哪些?
查看>>
经典SQL语句大全
查看>>
ftp免交互上传文件脚本
查看>>
linq 去除list集合中的重复项。
查看>>
php断点续传
查看>>
题目:最佳课题选择
查看>>
latex插入python代码
查看>>
448. Find All Numbers Disappeared in an Array
查看>>
Nginx 安装配置
查看>>
在 tornado 中异步无阻塞的执行耗时任务
查看>>
Android中的GridView
查看>>
12.创建一个Point类,有成员变量x,y,方法getX(),setX(),还有一个构造方 法初始化x和y。创建类主类A来测试它。...
查看>>
fastjson解析文本
查看>>
C#多线程Thread.Join()的详解
查看>>
ELK学习总结(1-3)倒排索引
查看>>
Progress and Prospect of target detection technology based on deep learning
查看>>
YUI Array 之dedupe(快速去重)
查看>>