SetSocket Method

Description

Sets the IP address and port of an audio control.

Syntax
object.SetSocket IPAddress IPPort

ParameterDescription
IPAddress Sets the IP address with a String value. You must use four numbers separated by periods. For multicasting, the first number of the four-number address must be a number from 224 through 239. Addresses starting with 239 are usually reserved for corporate intranet multicasting and are not passed beyond a firewall. Do not use a full address from 224.0.0.0 through 224.0.0.255, as those addresses are reserved for session notifications. A typical string for an address would be "239.240.100.1".
IPPort Sets the IP port. You must use an even number from 16384 through 32768, which are reserved for multicast audio ports and have the highest priority. Even numbers are required for RTP compliance.

Return Value

This method does not return a value.

Remarks

The SetSocket method must be used to set up player parameters before the Play method is called.

Parameter values are checked when SetSocket is called. E_INVALIDARG will be generated for the following parameter entries:

A socket is the name for the combination of an IP (Internet Protocol) address and an IP port. An IP address is four numbers, with each number being from 0 through 255. When an IP address is written out, each number is separated by a period. For example, a valid corporate intranet multicast IP address might be 239.4.7.54. An IP port is one number from 0 through 65535. For example, a valid multicast IP port might be 22560.

Example

The following code example shows how to use SetSocket. The audio control object is called rtpaudio and a button has been created called BtnPlay. When the button is clicked, the specified NetShow RTP Audio player will start.


Sub BtnPlay_OnClick
 call rtpaudio.Stop()
 call rtpaudio.SetSocket("239.240.100.2", 29102)
 call rtpaudio.Play()
End Sub

See Also

Play

Return to the RTP Audio Control Reference.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.