IOControlCode 列挙体
アセンブリ: System (system.dll 内)

Public Enumeration IOControlCode As Long


IOControlCode 列挙体には、ソケットの操作モードを指定する名前付きの値が用意されています。これらの値は、Windows Socket 2 (Winsock 2) WSAIoctl 関数に渡される制御コードです。

DataToRead パラメータ値を使用して IOControl(IOControlCode,Byte[],Byte[]) メソッドを呼び出し、その結果と Available プロパティにアクセスした場合を比較するコード例を次に示します。
static void DisplayPendingByteCount(Socket s) { byte[] outValue = BitConverter.GetBytes(0); // Check how many bytes have been received. s.IOControl(IOControlCode.DataToRead, null, outValue); uint bytesAvailable = BitConverter.ToUInt32(outValue, 0); Console.Write("server has {0} bytes pending. ", bytesAvailable); Console.WriteLine("Available property says {1}.", s.Available); return; }
void DisplayPendingByteCount( Socket^ s ) { array<Byte>^ outValue = BitConverter::GetBytes( 0 ); // Check how many bytes have been received. s->IOControl( IOControlCode::DataToRead, nullptr, outValue ); UInt32 bytesAvailable = BitConverter::ToUInt32( outValue, 0 ); Console::Write( "server has {0} bytes pending,", bytesAvailable ); Console::WriteLine( "Available property says {1}.", s->Available ); return; }
static void DisplayPendingByteCount(Socket s) { ubyte outValue[] = BitConverter.GetBytes(0); // Check how many bytes have been received. s.IOControl(IOControlCode.DataToRead, null, outValue); UInt32 bytesAvailable = BitConverter.ToUInt32(outValue, 0); //ToDo: Unsigned Integers not supported- converted to int Console.Write("server has {0} bytes pending. ", bytesAvailable.ToString()); Console.WriteLine("Available property says {1}.", (System.Int32)s.get_Available()); return; } //DisplayPendingByteCount

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- IOControlCode 列挙体のページへのリンク