相关文章  
  • Linux操作系统编程之Shell问答录
  • 深入浅出分析Linux系统内核漏洞的问题(3)
  • Linux脚本开发数学库在PHP中的重要性(3)
  • Linux脚本开发数学库在PHP中的重要性(2)
  • 简述Linux操作系统文件搜索(下)
  • 用GNUprofiler提高代码运行速度 上
  • 用GNUprofiler提高代码运行速度 下
  • linux的域名解析系统设置
  • 学习Linux网络编程之二
  • 学习Linux网络编程之一
  •   推荐  
      科普之友首页   专利     科普      动物      植物        天文   考古   前沿科技
     您现在的位置在:  首页 >>文献 >>培训

    学习Linux网络编程之三2

    int hostshort)
      unsigned long int ntohl(unsigned long int netlong)
      unsigned short int ntohs(unsigned short int netshort)

      在这四个转换函数中,h 代表host, n 代表 network.s 代表short l 代表long 第一个函数的意义是将本机器上的long数据转化为网络上的long. 其他几个函数的意义也差不多.

      3.2 IP和域名的转换
      在网络上标志一台机器可以用IP或者是用域名.那么我们怎么去进行转换呢?

      struct hostent *gethostbyname(const char *hostname)
      struct hostent *gethostbyaddr(const char *addr,int len,int type)
      在中有struct hostent的定义
      struct hostent{
      char *h_name; /* 主机的正式名称 */
      char *h_aliases;

    页码:[1] [2] [3] [4] [5] [6]2页、共6页

         

          设为首页       |       加入收藏       |       广告服务       |       友情链接       |       版权申明      

    Copyriht 2007 - 2008 ©  科普之友 All right reserved