zoukankan      html  css  js  c++  java
  • UNIX网络编程第三版源代码使用

    源代码下载地址http://www.unpbook.com/src.html

    最近在看Unix网络编程,1.2节给了一个简单的客户端的例子,功能是利用TCP协议获取服务器的时间,我先把下载的源代码到Ubuntu上面,然后解压

    tar -xzvf upv13e.tar.gz

    打开解压的目录,发现有个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 ../libroute # only if your system supports 4.4BSD style routing sockets     make           # only if your system supports 4.4BSD style routing sockets

        cd ../libxti   # only if your system supports XTI     make           # only if your system supports XTI

        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.

    按照步骤,先执行 ./configure

    再进入 lib目录 cd lib

    make

    进入libfree目录 cd ../libfree  然后 make

    会有一些警告,忽略就行了,剩下两个make 不成功也没关系 

    后面最重要的一步

    ./daytimetcpcli 127.0.0.1后发现报错,Connection Refused

    这个版本的Ubuntu默 认是不开daytime服务的,需要开启daytime服务,就在你当前的目录ls你可以看到有个daytimetcpsrv文件,执行sudo   ./daytimetcpsrv。它的功能就是开启本机的daytime服务,然后你再开启一个终端,敲击./daytimetcpcli 127.0.0.1,就可以看见时间了

  • 相关阅读:
    CentOS中的环境变量配置文件
    SCVMM中Clone虚拟机失败显示Unsupported Cluster Configuration状态
    Windows Server 2012 虚拟化实战:SCVMM的安装和部署
    Windows Server 2012 虚拟化实战:网络(二)
    x86.zip
    音视频处理之PS封装的介绍与使用20180928
    界面编程之QT的数据库操作20180801
    界面编程之QT的线程20180731
    界面编程之QT的Socket通信20180730
    界面编程之QT的文件操作20180729
  • 原文地址:https://www.cnblogs.com/sunyoung/p/6184005.html
Copyright © 2011-2022 走看看