摘要
Beginning with the simple introduction of socket which is the most commonly used application program interfaces in UNIX/LINUX communication domain, the concrete programming procedures to realize multicast and broadcast based on socket is provided, according to TCP/IP protocol in LINUX system. The acquiring and converting of broadcast destination address and multicast address, the setting of multicast options, the joining in and withdrawing from the multicast group, and the receiving and sending of datagram are all demonstrated in it, the related system calls and simple explication of C programming are also included.
简单介绍了UNIX/LINUX通信域中最常用的应用程序接口———套接字 ,在此基础上 ,详细描述了在LINUX系统中按照TCP/IP协议 ,实现基于套接字的多目通信、广播通信的具体编程步骤 ,包括广播目的地址、多目地址的获取与转换 ,多目通信中特征选项的设置 ,多目组的加入与退出 ,报文的发送与接收等 ,同时也给出了相关的系统调用及程序段说明 .