《UNIX网络编程》源码的使用

本文详细介绍了在Linux环境下使用UNIX网络编程第一卷源码的方法,并指导如何在Ubuntu中启动daytime服务,解决连接错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

UNIX网络编程 第一卷:套接口API (第3版)

源码下载:http://www.ituring.com.cn/book/164?q=unix%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B


在Linux 下的使用

Linux也是UNIX,当然没问题!现在说明如何使用书本源码unpv13e.tar.gz的问题。

首先,解压源码

其后,阅读解压后目录unpv13e下的README文档!

QUICK AND DIRTY

===============

Execute the following from the src/ directory:

    ./configure    # try to figure out all implementation differences

    cd lib         # build the basic library that all programs need
    make           # use "gmake" everywhere on BSD/OS systems

    cd ../libfree  # continue building the basic library
    make

    cd ../intro    # build and test a basic client program
    make daytimetcpcli   
    ./daytimetcpcli 127.0.0.1

If all that works, you're all set to start compiling individual programs.

Notice that all the source code assumes tabs every 4 columns, not 8.

========================


最后运行:./daytimetcpcli 127.0.0.1
发现报错:connect error: Connection refused
这种情况说明服务器没有启动daytime服务!

Ubuntu启动daytime服务
1. sudo apt-get install xinetd
2. sudo vi /etc/xinetd.d/daytime, 将disable = yes改为no
3. sudo /etc/init.d/xinetd restart
运行如下:
zy@zy-ubuntu:~/unp/unpv13e/intro$ ./daytimetcpcli 127.0.0.1
28 FEB 2014 01:16:08 CST
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值