1) 安装virtual box 和 FC19, 搞定system-config-samba和gcc
sudo yum -y install samba
sudo yum install gcc g++
2)从图灵网站上下载UNP13E,配合unix网络编程 卷1 第三版
http://www.ituring.com.cn/book/download/60498ad9-ede6-4023-a92b-04d47be23578
3)编译UNP13E, 按照Readme来做就是了
./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 ../libroute # only if your system supports 4.4BSD style routing sockets #FC19我安装的不支持4.4BSD,会报错,直接无视
make # only if your system supports 4.4BSD style routing sockets
cd ../libxti # only if your system supports XTI #我下载的包里没有libxti
make # only if your system supports XTI
cd ../libgai #但是有这个libgai
make
4)运行第一个sample
cd ../intro # build and test a basic client program
make daytimetcpcli
./daytimetcpcli 127.0.0.1
直接报错
[legend@localhost intro]$ ./daytimetcpcli 127.0.0.1
connect error: Connection refused
找帮助,需要daytime开启才好
sudo yum -y install xinetd
sudo vi /etc/xinetd.d/daytime-stream
sudo vi /etc/xinetd.d/daytime-dgram
编辑修改daytime-stream和daytime-dgram如下
# This is for quick on or off of the service
disable = no
sudo systemctl restart xinetd.service
再接着运行daytimetcpcli 就好了
[legend@localhost intro]$ ./daytimetcpcli 127.0.0.1
11 SEP 2013 19:01:42 CST