UdpAnySourceMulticastClient.BeginSendToGroup 方法       
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.
开始执行将数据包发送到已联接的多播组的操作,并在已将数据包发送到组时调用指定的回调。
public:
 IAsyncResult ^ BeginSendToGroup(cli::array <System::Byte> ^ buffer, int offset, int count, AsyncCallback ^ callback, System::Object ^ state);[System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)]
public IAsyncResult BeginSendToGroup(byte[] buffer, int offset, int count, AsyncCallback callback, object state);[<System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)>]
member this.BeginSendToGroup : byte[] * int * int * AsyncCallback * obj -> IAsyncResultPublic Function BeginSendToGroup (buffer As Byte(), offset As Integer, count As Integer, callback As AsyncCallback, state As Object) As IAsyncResult参数
- buffer
- Byte[]
包含要发送的数据的缓冲区。
- offset
- Int32
要从中读取待发送数据的从 buffer 开始处的偏移量(以字节为单位)。
- count
- Int32
要从 buffer 发送的字节数。
- callback
- AsyncCallback
要在此操作完成时调用的回调方法。
- state
- Object
要为此操作传递给 callback 方法的可选状态信息。
返回
引用此操作的 IAsyncResult。
- 属性
例外
              buffer 为 null 引用(在 Visual Basic 中为 Nothing)。
              offset 小于 0
- 或 -
              offset 大于 buffer 的长度。
- 或 -
              count 小于 0
- 或 -
              offset 加上此计数大于 buffer 的长度。
尚未联接多播组。
尝试访问套接字时出错。
注解
方法 BeginSendToGroup 开始将 UDP 数据包发送到联接的多播组的操作。
客户端必须已完成多播组的加入。
当收到数据包时, callback 将调用 参数中指定的方法。
如果接收操作同步失败,则可能会发生套接字故障,尽管这在 UDP 中并不常见。 如果发生套接字故障, SocketException 将引发 。 收到的错误指定为 枚举的成员 SocketError 。