TransmitFileOptions 列挙体とは? わかりやすく解説

TransmitFileOptions 列挙体

メモ : この列挙体は、.NET Framework version 2.0新しく追加されたものです。

TransmitFileOptions 列挙体は、ファイル転送要求使用する値を定義します

この列挙体には、メンバ値のビットごとの組み合わせ可能にする FlagsAttribute 属性含まれています。

名前空間: System.Net.Sockets
アセンブリ: System (system.dll 内)
構文構文

<FlagsAttribute> _
Public Enumeration TransmitFileOptions
Dim instance As TransmitFileOptions
[FlagsAttribute] 
public enum TransmitFileOptions
[FlagsAttribute] 
public enum class TransmitFileOptions
/** @attribute FlagsAttribute() */ 
public enum TransmitFileOptions
FlagsAttribute 
public enum TransmitFileOptions
メンバメンバ
 メンバ説明
Disconnectすべてのファイル データ伝送キュー置かれ後でトランスポート レベル接続解除開始しますReuseSocket使用する場合、これらのフラグは、ファイル送信後に、ソケット接続解除された再利用可能な状態に戻します。 
ReuseSocket要求完了すると、ソケット ハンドル再利用できます。このフラグは、同時に Disconnect指定されている場合にだけ有効です。Disconnect使用する場合、これらのフラグは、ファイル送信後に、ソケット接続解除された再利用可能な状態に戻します。 
UseDefaultWorkerThread既定スレッド使用して長いファイル転送要求処理します。 
UseKernelApc長いファイル転送要求処理するには、ワーカー スレッド代わりにカーネル非同期プロシージャ呼び出し (APC: asynchronous procedure call) を使用します長い要求は、ファイルキャッシュから複数回読取りを行う必要がある要求として定義されます。たがって、この要求ファイルサイズ送信パケット指定した長さ依存します。 
UseSystemThreadシステム スレッド使用して長いファイル転送要求処理します。 
WriteBehindファイル転送要求を、保留せず、すぐに完了させます。このフラグ指定されていてファイル転送成功した場合データシステムによって受け入れられますが、リモート エンドによって応答されるとは限りません。このフラグを、Disconnect フラグおよび ReuseSocket フラグと共に使用しないください。 
解説解説
使用例使用例

SendFile の呼び出し時で TransmitFileOptions使用する方法次のコード例示しますファイル "test.txt" は、ローカル コンピュータルート ディレクトリあります。この例では、事前バッファリング事後バッファリングデータ作成されファイルと共にリモート ホスト送信されます。システム既定スレッド使用するために、UseDefaultWorkerThread が指定されます。

// Establish the local endpoint for the socket.
IPHostEntry ipHost = Dns.Resolve(Dns.GetHostName());
IPAddress  ipAddr = ipHost.AddressList[0];
IPEndPoint ipEndPoint = new IPEndPoint(ipAddr, 11000);

// Create a TCP socket.
Socket client = new Socket(AddressFamily.InterNetwork,
        SocketType.Stream, ProtocolType.Tcp);

// Connect the socket to the remote endpoint.
client.Connect(ipEndPoint);

// Send file fileName to the remote host with preBuffer and postBuffer
 data.
// There is a text file test.txt located in the root directory.
string fileName = "C:\\test.txt";
       
// Create the preBuffer data.
string string1 = String.Format("This is text data that precedes
 the file.{0}", Environment.NewLine);
byte[] preBuf = Encoding.ASCII.GetBytes(string1);

// Create the postBuffer data.
string string2 = String.Format("This is text data that will
 follow the file.{0}", Environment.NewLine);
byte[] postBuf = Encoding.ASCII.GetBytes(string2);

//Send file fileName with buffers and default flags to the remote device.
Console.WriteLine("Sending {0} with buffers to the host.{1}", fileName,
 Environment.NewLine);
client.SendFile(fileName, preBuf, postBuf, TransmitFileOptions.UseDefaultWorkerThread);

// Release the socket.
client.Shutdown(SocketShutdown.Both);
client.Close();

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
System.Net.Sockets 名前空間


このページでは「.NET Framework クラス ライブラリ リファレンス」からTransmitFileOptions 列挙体を検索した結果を表示しています。
Weblioに収録されているすべての辞書からTransmitFileOptions 列挙体を検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からTransmitFileOptions 列挙体 を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

TransmitFileOptions 列挙体のお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



TransmitFileOptions 列挙体のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS