Distribution Stream Sample

This sample application, written in Microsoft® Visual Basic®, demonstrates how to multicast a stream that originates from another server. By default, the source code is located in C:\Program Files\Windows Media Components\SDK\Source\Multicast\Distrib.

In this application, the Stations variable refers to the Windows Media Station control. It is assumed that there are two servers that are running Windows Media Services, Server1 and Server2, to which you have access. A Station and a Stream are created on each server, even though only one title is streamed.

The MyStream.asf file is installed on the first server in the Asfroot directory on the C drive.

To create a Station, invoke the Open method of the Channels collection object.

To add MyStream.asf to the stream, name the new station Dist3, and set its DeliveryMode property for distribution.

To multicast the MyStream.asf to clients, creates a Station on the second server, and specifies the multicast address and port number to which instances of Windows Media Player can be tuned to listen to the stream. The IP address and port number are not required for setting the distrubtion channel.

For this station to understand the format of the incoming stream, the appropriate station format must be added by using the Add method of the ChannelFormats collection object. Because the stream originates from the first server that is running Windows Media Services, a different streaming protocol, MSBD, is used for the stream on the second server.

To remove the Station and the Stream, invoke the Close method of the station and stream objects, respectively.