z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


IP_MULTICAST_TTL

z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
SC27-3660-00

The IP_MULTICAST_TTL socket option allows the application to primarily limit the lifetime of the packet in the Internet and prevent it from circulating indefinitely. This option also serves to allow the application to specify administrative boundaries. This administrative region is specified in terms such as "this site", "this company", or "this state", and is relative to the starting point of the packet. The region associated with a multicast packet is called its scope. The default value is 1, meaning multicast is available only to the local subnet. Figure 1 illustrates the use of IP_MULTICAST_TTL by the use of the SETSOCKOPT and GETSOCKOPT APIs.
Figure 1. IP_MULTICAST_TTL
***********************************************************************  
*                                                                     *  
*        Issue SETSOCKOPT/GETSOCKOPT - IP_MULTICAST_TTL               *  
*                                                                     *  
***********************************************************************  
*                                                                        
* SET TTL TO SAME SITE                                   
*                                                        
         EZASMI TYPE=SETSOCKOPT,  ISSUE SETSOCKOPT                     X 
               S=S,               SOCKET DESCRIPTOR                    X 
               OPTLEN=OPTLEN1,    OPTION LENGTH                        X 
               OPTNAME='IP_MULTICAST_TTL', OPTION NAME                 X 
               OPTVAL=SAMESITE,   OPTION VALUE                         X 
               RETCODE=RETCODE,   (SPECIFY RETCODE FIELD)              X 
               ERROR=ERROR        ABEND IF MACRO ERROR 
         BAL   R14,RCCHECK         --> CHECK IT           
*                                                    
* DISPLAY TTL, SHOULD BE 32                          
*                                                       
         XC    OPTVAL4,OPTVAL4                      
         EZASMI TYPE=GETSOCKOPT,  ISSUE GETSOCKOPT                     X 
               S=S,               SOCKET DESCRIPTOR                    X 
               OPTLEN=OPTLEN1,    OPTION LENGTH                        X 
               OPTNAME='IP_MULTICAST_TTL', OPTION NAME                 X 
               OPTVAL=OPTVAL4,    OPTION VALUE                         X 
               RETCODE=RETCODE,   (SPECIFY RETCODE FIELD)              X 
               ERROR=ERROR        ABEND IF MACRO ERROR  
         BAL   R14,RCCHECK         --> CHECK IT             

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014