UdpSingleSourceMulticastClient.BeginSendToSource メソッド

定義

注意事項

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

前に指定された送信元にユニキャスト パケットを送信する操作を開始します。

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

パラメーター

buffer
Byte[]

送信するデータが格納されているバッファー。

offset
Int32

送信するデータを読み取る buffer の先頭からのバイト単位のオフセット。

count
Int32

buffer から送信するバイト数。

remotePort
Int32

パケットを送信するリモート ポート。 リモート アドレスは UdpSingleSourceMulticastClient(IPAddress, IPAddress, Int32) コンストラクターによって指定されます。

callback
AsyncCallback

操作の完了時に呼び出されるコールバック メソッド。

state
Object

この操作の callback メソッドに渡す省略可能な状態情報。

戻り値

この操作を参照する IAsyncResult

属性

例外

buffer が null 参照 (Visual Basic では Nothing) です。

offset が 0 未満です。

- または -

offsetbuffer の長さを超えています。

- または -

count が 0 未満です。

- または -

offset にカウントを加算した値が buffer の長さを超えています。

- または -

remotePort が 0 より小さいか、65,535 を超えています。

マルチキャスト グループにまだ参加していません。

ソケットへのアクセスを試行しているときにエラーが発生しました。

注釈

メソッドは BeginSendToSource 、先ほど指定したソースに UDP パケットを送信する操作を開始します。

一部のプロトコルでは、この情報を使用して、フロー制御、サービスの品質統計、または回復メッセージを渡します。

パラメーターで callback 指定されたメソッドは、パケットが送信されたときに呼び出されます。

クライアントがマルチキャスト グループへの参加を完了している必要があります。

パラメーターで remotePort 指定された宛先ポートが 1,024 未満の場合は、 SocketException を指定して AccessDeniedがスローされます。

送信操作が同期的に失敗した場合、ソケットエラーが発生する可能性がありますが、これは UDP では一般的ではありません。 ソケットエラーが発生した場合は、 SocketException がスローされます。 受け取ったエラーは、 列挙体の SocketError メンバーとして指定されます。

適用対象