For specific SL source multicast and any source multicast, you must obtain the authorization of port 9430 of the current domain before joining the group.
The request authorization message is called "Announcement", and the response message is called "Authorization ". 0 and 1 respectively.
The formats of announcements and authentication messages are as follows: Struct Silverlightpolicymessage { Byte [ 3 ] Header = " Sl \ 0 " ; Byte Version = 1 ; Byte Messagetype = {announcement:0 , Authorization: 1 }; Byte [ 4 ] Messageid; Byte [ 2 ] Port; Byte [ 2 ] Applicationoriginurilength; Byte Groupaddresslength; Byte [Applicationoriginurilength] applicationoriginuri; Byte [Groupaddresslength] groupaddress ;}
If the application is confirmedProgramIf the source Uri has the right to join the requested multicast group, change the 5th bytes of the Message Type to 1, indicating that the message can be authorized as the response data:
BelowCodeTest passed:
Static Udpclient client = Null ; Static Void Main ( String [] ARGs) {Client = New Udpclient ( 9430 ); // When the SL client requests authorization, the authorization is verified to port 9430. Client. beginreceive (receivecallback, Null ); Console. Read ();} Static Void Effececallback (iasyncresult result) {ipendpoint remoteep = Null ; Byte [] Announcement = client. endreceive (result, Ref Remoteep ); // Receive announcement If (Result. iscompleted) {console. writeline (remoteep. Address. tostring () + " : " + Remoteep. Port); Announcement [ 4 ] = 1 ; // 5th bytes 0 indicates announcement, 1 indicates authorization. The other data remains unchanged, and the message is changed to authorization as a response Client. beginsend (Announcement, announcement. length, remoteep, sendcallback, Null ); Console. writeline ( " Done " );}} Static Void Sendcallback (iasyncresult asyncresult) {client. endsend (asyncresult ); If (Asyncresult. iscompleted) {console. writeline ( " Sended " );}}
After such processing, debugging of Multicast Applications becomes easier.