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 ...
随机推荐
- android中百度地图定位的实现方法(仅适用于真机+WIFI联网环境)
注意:此代码的环境是:真机(系统版本为Android4.2.2)+WIFI联网(才能实现最后的运行结果):使用虚拟机调试会出现各种问题. 第一步:下载SDK和申请Key 到百度的网站http://de ...
- android-'Using 1.7 requires compiling with Android 4.4 (KitKat); currently using API 8'
解决的方案是将jdk1.7制定的版本定制为jdk.6.即 在eclipse中,右键项目->Properties->Java Compiler->enable "projec ...
- Android 的 Relative Layout 常量
android:layout_above 将该控件的底部置于给定ID的控件之上 --Rule that aligns a child's bottom edge ...
- 监听器启动顺序和java常见注解
- 获取fragment中的控件的写法
package com.example.baoxiu.fragment;import com.example.baoxiu.R;import com.example.baoxiu.Register;i ...
- Cookie、LocalStorge、SesstionStorge 的区别和用法
前言 总括:详细讲述Cookie.LocalStorge.SesstionStorge的区别和用法. 1. 各种存储方案的简单对比 Cookies:浏览器均支持,容量为4KB UserData:仅IE ...
- mybatis中association的column传入多个参数值
顾名思义,association是联合查询. 在使用association中一定要注意几个问题.文笔不好,白话文描述一下. 1: <association property="fncg ...
- 新思路:Exception Handle
以前提到异常处理,马上就想到加try-catch. 没错,这种应激反应是对的.关键是怎么加? 如果想为每一个方法都加异常处理,输出相同格式的异常信息,应该怎么做呢? 难道是为每一个方法加一个try-c ...
- Delphi-UpperCase 函数
函数名称 UpperCase 所在单元 System.SysUtils 函数原型 function UpperCase(const S: string): string; 函数功能 将字符串中所有的小 ...
- hdu2524 (求矩形个数,水题。。。)
hdu 2524 N - 暴力求解.打表 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64 ...