UdpSingleSourceMulticastClient.BeginSendToSource(Byte[], Int32, Int32, Int32, AsyncCallback, Object) Método
Definição
Cuidado
This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Inicia a operação de envio de um pacote de unicast para a origem especificada anteriormente.Begins the operation of sending a unicast packet to the source previously specified.
public:
IAsyncResult ^ BeginSendToSource(cli::array <System::Byte> ^ buffer, int offset, int count, int remotePort, 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 BeginSendToSource (byte[] buffer, int offset, int count, int remotePort, 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.BeginSendToSource : byte[] * int * int * int * AsyncCallback * obj -> IAsyncResult
Public Function BeginSendToSource (buffer As Byte(), offset As Integer, count As Integer, remotePort As Integer, callback As AsyncCallback, state As Object) As IAsyncResult
Parâmetros
- buffer
- Byte[]
O buffer que contém os dados a serem enviados.The buffer that contains the data to send.
- offset
- Int32
O deslocamento, em bytes, do início do buffer para ler os dados a serem enviados.The offset, in bytes, from the beginning of the buffer to read the data to be sent.
- count
- Int32
O número de bytes a serem enviados do buffer.The number of bytes to send from the buffer.
- remotePort
- Int32
A porta remota para a qual o pacote será enviado.The remote port to which the packet is to be sent. O endereço remoto é especificado pelo construtor UdpSingleSourceMulticastClient(IPAddress, IPAddress, Int32).The remote address is specified by the UdpSingleSourceMulticastClient(IPAddress, IPAddress, Int32) constructor.
- callback
- AsyncCallback
O método de retorno de chamada a ser invocado quando a operação for concluída.The callback method to invoke when the operation completes.
- state
- Object
As informações opcionais de estado a serem passadas para o método callback para essa operação.Optional state information to pass to the callback method for this operation.
Retornos
Um IAsyncResult que faz referência a essa operação.An IAsyncResult that references this operation.
- Atributos
Exceções
buffer é uma referência nula (Nada no Visual Basic).buffer is a null reference (Nothing in Visual Basic).
offset é menor que 0offset is less than 0
- ou --or-
offset é maior que o comprimento do buffer.offset is greater than the length of the buffer.
- ou --or-
count é menor que 0count is less than 0
- ou --or-
offset mais a contagem é maior que o comprimento do buffer.offset plus the count is greater than the length of the buffer.
- ou --or-
remotePort é menor que 0 ou maior que 65.535.remotePort is less than 0 or greater than 65,535.
O grupo de multicast ainda não foi unido.The multicast group has not yet been joined.
O UdpSingleSourceMulticastClient foi descartado.The UdpSingleSourceMulticastClient has been disposed.
Ocorreu um erro ao tentar acessar o soquete.An error occurred when attempting to access the socket.
Comentários
O BeginSendToSource método inicia uma operação de envio de um pacote UDP para a origem especificada anteriormente.The BeginSendToSource method begins an operation of sending a UDP packet to the source previously specified.
Alguns protocolos usam essas informações para passar pelo controle de fluxo, qualidade de estatísticas de serviço ou mensagens de recuperação.Some protocols use this information to pass along flow control, quality of service statistics, or recovery messages.
O método especificado no callback parâmetro é invocado quando um pacote é enviado.The method specified in the callback parameter is invoked when a packet has been sent.
O cliente deve ter concluído uma junção ao grupo de multicast.The client must have completed a join to the multicast group.
Se a porta de destino especificada no remotePort parâmetro for menor que 1.024, um SocketException será lançado com AccessDenied .If the destination port specified in the remotePort parameter is less than 1,024, a SocketException is thrown with AccessDenied.
É possível ter uma falha de soquete se uma operação de envio falhar de forma síncrona, embora isso não seja comum com o UDP.It is possible to have a socket failure if a send operation fails synchronously, although this is uncommon with UDP. Se ocorrer uma falha de soquete, um SocketException será gerado.If a socket failure occurs, a SocketException is thrown. O erro recebido é especificado como um membro da SocketError enumeração.The error received is specified as a member of the SocketError enumeration.