unix网络编程第三版源代码ubuntu下配置的问题解决
第一步:首先下载本书配套的源码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 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网络编程第三版源代码ubuntu下配置的问题解决的更多相关文章
- 【unix网络编程第三版】ubuntu端口占用问题
<unix网络编程>一书中的代码并不是能直接运行,有时候需要结合各方面的知识来解决,大家在这本书的时候,一定要把代码都跑通,不难你会错过很多学习的机会! 1.问题描述 本人在阅读<U ...
- 【unix网络编程第三版】阅读笔记(三):基本套接字编程
unp第三章主要介绍了基本套接字编程函数.主要有:socket(),bind(),connect(),accept(),listen()等. 本博文也直接进入正题,对这几个函数进行剖析和讲解. 1. ...
- 【unix网络编程第三版】阅读笔记(五):I/O复用:select和poll函数
本博文主要针对UNP一书中的第六章内容来聊聊I/O复用技术以及其在网络编程中的实现 1. I/O复用技术 I/O多路复用是指内核一旦发现进程指定的一个或者多个I/O条件准备就绪,它就通知该进程.I/O ...
- 【UNIX网络编程第三版】阅读笔记(一):代码环境搭建
粗略的阅读过<TCP/IP详解>和<计算机网络(第五版)>后,开始啃这本<UNIX网络编程卷一:套接字联网API>,目前linux下的编程不算太了解,在阅读的过程中 ...
- 【unix网络编程第三版】阅读笔记(二):套接字编程简介
unp第二章主要将了TCP和UDP的简介,这些在<TCP/IP详解>和<计算机网络>等书中有很多细致的讲解,可以参考本人的这篇博客[计算机网络 第五版]阅读笔记之五:运输层,这 ...
- 【unix网络编程第三版】阅读笔记(四):TCP客户/服务器实例
本篇博客主要记录一个完整的TCP客户/服务器实例的编写,以及从这个实例中引发的对僵死进程的处理等问题. 1. TCP客户/服务器功能需求 本实例完成以下功能: (1) 客户从标准输入读入一行文本,并写 ...
- UNIX 网络编程第三版
第五章p102: ps -t pts/6 -o pid,ppid,tty,stat,args,wchan 在我的系统上运行时出现:TTY not found linux发行版为mint17.1 改用 ...
- Unix网络编程第三版源码编译
配置: $ cd Unix-Network-Programming/ $ chmod 755 configure $ ./configure 主要的工作是检查系统是否有源码编译所依赖的各种资源(系统版 ...
- 《UNIX网络编程(第3版)》unp.h等源码文件的编译安装
操作系统:Mac OS X 10.11.5 1.下载书中的源代码:点击下载 2.切换到解压后的目录 unpv13e,先查看下 README,依次执行: ./configure cd lib make ...
随机推荐
- LinqJoin方法
Linq知识点总结: (一).构建两个List泛型集合 List<Person> list=new List<Person>() { ...
- B/S 獲取客戶端Mac地址
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx. ...
- spring 4 xxx 与jackson-dataformat.xxx类冲突
这段时间,做一个新的工作流的开发,在开始之初,用的jbpm,后来发现jbpm现在开发有问题,不能引用官方的工作空间,所要工作流跑不起来,于是用了activiti工作流,在配置spring和activi ...
- Animator Override Controllers 学习及性能测试
本文由博主(YinaPan)原创,转载请注明出处:http://www.cnblogs.com/YinaPan/p/Unity_AnimatorOverrideContorller.html The ...
- SqlParameter的用法和好处
关于Sql注入的基本概念,相信不需要多说,大家都清楚,经典的注入语句是' or 1=1--单引号而截断字符串,"or 1=1"的永真式的出现使得表的一些信息被暴露出来,如果sql语 ...
- 【USACO 1.4.4】母亲的牛奶
[题目描述] 农民约翰有三个容量分别是A,B,C升的桶,A,B,C分别是三个从1到20的整数, 最初,A和B桶都是空的,而C桶是装满牛奶的.有时,约翰把牛奶从一个桶倒到另一个桶中,直到被灌桶装满或原 ...
- jQuery banner 滑动
jQuery(document).ready(function() { var abovePos = 50; var customMax = 1600; var zIdx = 100; var $bn ...
- mktime性能问题
#include <time.h> int main() { for (int i = 0; i < 100000; ++i) { struct tm tm = {}; tm.tm_ ...
- windows Server 2008 IIS7 503错误解决方案
windows 2008 R2 在访问的时候经常会出现503错误,于之前使用的是默认配置,服务器最多只能处理5000个同时请求,今天下午由于某种情况造成同时请求超过5000,下面是具体的解决方案: w ...
- checkbox复选框全选批量删除
多选框全选实现批量删除 html代码 <body> <form action="" method="post" name="Form ...