Export (0) Print
Expand All

UdpAnySourceMulticastClient.BeginSendTo Method

.NET Framework 4.5

Note: This API is now obsolete.

Begins the operation of sending a unicast packet to the specified destination.

Namespace:  System.Net.Sockets
Assembly:  System.Net (in System.Net.dll)

[ObsoleteAttribute("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", 
	true)]
public IAsyncResult BeginSendTo(
	byte[] buffer,
	int offset,
	int count,
	IPEndPoint remoteEndPoint,
	AsyncCallback callback,
	Object state
)

Parameters

buffer
Type: System.Byte[]

The buffer that contains the data to send.

offset
Type: System.Int32

The offset, in bytes, from the beginning of the buffer to read the data to be sent.

count
Type: System.Int32

The number of bytes to send from the buffer.

remoteEndPoint
Type: System.Net.IPEndPoint

The remote endpoint to which the packet is to be sent.

callback
Type: System.AsyncCallback

The callback method to invoke when the operation completes.

state
Type: System.Object

Optional state information to pass to the callback method for this operation.

Return Value

Type: System.IAsyncResult
Returns IAsyncResult.
An IAsyncResult that references this operation.

ExceptionCondition
ArgumentNullException

buffer is a null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

offset is less than 0

-or-

offset is greater than the length of the buffer.

-or-

count is less than 0

-or-

offset plus the count is greater than the length of the buffer.

InvalidOperationException

The multicast group has not yet been joined.

ObjectDisposedException

The UdpAnySourceMulticastClient has been disposed.

SocketException

An error occurred when attempting to access the socket. See the Remarks section for more information.

The BeginSendTo method begins an operation of sending a UDP packet to the joined multicast group.

The client must have completed a join to the multicast group. The destination address specified in the remoteEndPoint parameter must have already sent a multicast packet to this receiver. Some protocols use this information to pass along flow control, quality of service statistics, or recovery messages.

The method specified in the callback parameter is invoked when a packet has received.

The transmission is only allowed if the address specified in the remoteEndPoint parameter has already sent a multicast packet to this receiver. If the client is not allowed access, a SocketException is thrown with AccessDenied.

If the destination port specified in the remoteEndPoint parameter is less than 1,024, a SocketExceptionis thrown with AccessDenied.

It is possible to have a socket failure if a receive operation fails synchronously, although this is uncommon with UDP. If a socket failure occurs, a SocketException is thrown. The error received is specified as a member of the SocketError enumeration.

.NET Framework

Obsolete (does not compile) in 4.5.2 and later

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft