Windows Media Services SDK banner art
PreviousNext

SourceAddress Property

Returns the source address of the file transfer.

Syntax

NSFile.SourceAddress

Remarks

This property can be used to determine the IP address of the sender. One of the uses of this property is to ensure that the source from which you receive a transfer is the correct one. This property can be useful both as a security measure to validate multicast sources, and to sort out transfers from more than one source. The EndpointAddress property in a multicast transfer indicates the multicast address that the receiver is listening to, not the address of the sender.

This property is available after at least one file transfer.

The following example shows how to add minimal security to a multicast file transfer. The File Transfer control is named nsfile. When the Transfer Started event is triggered, a check is made to see whether the source address is the one expected (239.4.7.54). If it is not, then a subroutine (StopTransfer) is called that cancels the transfer and notifies the user.

Sub NSFile_FtsOnTransferStarted
 If Not (nsfile.SourceAddress = "239.4.7.54") Then StopTransfer
End Sub
...
Sub StopTransfer
 nsfile.FtsCancelFileTransferReceive()
 MsgBox ("The transfer has been cancelled. Wrong source address.")
End Sub
PreviousNext


© 1996-1999 Microsoft Corporation. All rights reserved.