source code下载地址:unpv13e.tar.gz下载 (也有放一份在google cloud storage)
compile
1.
./configure
2.
cd lib
make
3.
cd libfree
修改inet_ntop.c
60 size_t size; 變成 60 socklen_t size;
make
4.(感覺這一步應該不用做)
cd ../libgai
make
5.
cd ../intro # build and test a basic client program
make daytimetcpcli
./daytimetcpcli 127.0.0.1
會出現connect error: Connection refused
因为这个版本的系统默认是不开daytime服务的,而且开启daytime服务需要有root权限,
然后你会看到在相同的目录下有一个daytimetcpsrv.c文件,编译后执行它(下make),注意需要有root权限,
即sudo ./daytimetcpsrv。它的功能就是开启本机的daytime服务,然后你再开启一个终端,敲击./daytimetcpcli 127.0.0.1后返回了你想要的结果。
PS其實第五步驟步驟,不要照它README去做
改成
cd ../intro
make
sudo ./daytimetcpsrv &
./daytimetcpcli 127.0.0.1
就可以了