source code下载地址:unpv13e.tar.gz下载 (也有放一份在google cloud storage)

compile

1.

./configure

2.

cd lib

make

3.

    cd libfree

修改inet_ntop.c

 size_t size;
變成
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

就可以了

unix network programming volume1 sorce code build and get(UNIX網絡編程卷1第三版)的更多相关文章

  1. unix network programming(3rd)Vol.1 [第1章]《读书笔记系列》

    文章最开头介绍了 获取时间的C/S 模型的代码, 还用了实现了IPV6的版本 unix 介绍了errno值,以及在多进程/多线程中的问题 多线程中不用全局errno,而是用返回值 处理error 详细 ...

  2. Unix NetWork Programming(unix环境编程)——环境搭建(解决unp.h等源码编译问题)

    此配置实例亲测成功,共勉,有问题大家留言. 环境:VMware 10 + unbuntu 14.04 为了unix进行网络编程,编程第一个unix程序时遇到的问题,不能包含unp.h文件,这个感觉和a ...

  3. 【转】Unix NetWork Programming——环境搭建(解决unp.h等源码编译问题)

    下面开始用简单但典型的客户端和服务器端程序说明如何进行网络编程.这一小节讲的是客户端,一个用来连接并读取服务器发送来的时间的客户端. 这里涉及到了编写代码,因此要 搭建unix网络编程环境 unix系 ...

  4. 【转】【Raspberry Pi】Unix NetWork Programming:配置unp.h头文件环境

    一.初衷 近期正在做网络计算编程的作业.要求平台为unix/linux,想着Raspberry Pi装的Debian系统也是Linux改的,也应该能够勉强用着,所以就用它来做作业了! 二.说明 先把环 ...

  5. unix network programming(3rd)Vol.1 [第2~5章]《读书笔记系列》

    13~22章 重要 第2章 传输层: TCP/ UDP / STCP (Stream Control Transmission Protocol) TCP 可靠,有重传机制,SYN队列号 UDP 不可 ...

  6. unix network programming(3rd)Vol.1 [第13~15章]《读书笔记系列》

    第13章 守护进程和inetd 超级服务器 syslog() daemon_init() setuid() setgid() 第14章 高级IO 标准I/O函数库,支持3种缓冲 缓冲(读写存储设备(硬 ...

  7. Unix NetWork Programming -- 环境搭建(Ubuntu 12.04 x86_64)

    1. 下载源代码:http://www.ituring.com.cn/book/download/60498ad9-ede6-4023-a92b-04d47be23578 2. 解压文件后进入文件根目 ...

  8. 课程一(Neural Networks and Deep Learning),第二周(Basics of Neural Network programming)—— 4、Logistic Regression with a Neural Network mindset

    Logistic Regression with a Neural Network mindset Welcome to the first (required) programming exerci ...

  9. Python socket – network programming tutorial

    原文:https://www.binarytides.com/python-socket-programming-tutorial/ --------------------------------- ...

随机推荐

  1. shell test 數值 字符串 文件比較

    數值比較 描述 n1 –eq n2 等於 n1 –gt  n2 大於 n1 –ge n2 大於等於 n1 –lt  n2 小於 n1 –le n2 小於等於 n1 –ne n2 不等於   字符串比較 ...

  2. php抓取网页信息

    index.php <?php include_once 'simple_html_dom.php'; //获取html数据转化为对象 $html = file_get_html('http:/ ...

  3. linux c学习笔记----互斥锁属性

    转自:http://lobert.iteye.com/blog/1762844 互斥锁属性 使用互斥锁(互斥)可以使线程按顺序执行.通常,互斥锁通过确保一次只有一个线程执行代码的临界段来同步多个线程. ...

  4. Ubuntu 上安装 MongoDB

    官方安装文档:https://docs.mongodb.com/manual/installation/ 安装环境: mongodb-linux-x86_64-ubuntu1404-3.2.6.tgz ...

  5. How to install the zsh shell in Linux && how to set it as a default login shell

    Z shell’s (zsh) popularity has increased in the last years. I have not moved too zsh yet, but I am g ...

  6. 深入理解计算机中的 csapp.h和csapp.c

    csapp.h其实就是一堆头文件的打包,在http://csapp.cs.cmu.edu/public/code.html 这里可以下载.这是<深入理解计算机系统>配套网站. 在头文件的# ...

  7. maven web启动报错java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener

    问题描述 SEVERE: Error configuring application listener of class org.springframework.web.util.Log4jConfi ...

  8. SQLServer批量创建有规则的数据

    根据需求要生成从kkk001,kkk002开始的100个递增账号 手插要死人的,用SQL脚本轻松完成: declare @a int ) ) begin ) ) end declare:申明变量, @ ...

  9. Linux将文件拷到u盘

    1:终端中获取root后,使用fdisk -l来查看位置 2:挂载u盘:mount /路径 /mnt cd /mnt可进入u盘,ls可查看文件 3:复制:cp /(文件路径) /mnt 4:退出u盘: ...

  10. AOP静态代理解析1-标签解析

    AOP静态代理使用示例见Spring的LoadTimeWeaver(代码织入) Instrumentation使用示例见java.lang.instrument使用 AOP的静态代理主要是在虚拟机启动 ...