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

Public Enumeration SocketOptionName


SocketOptionName 列挙体は、各 Socket 構成オプションの名前を定義します。ソケットは、Socket.SetSocketOption メソッドを使用して構成されます。
Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows CE プラットフォームメモ : .NET Compact Framework アプリケーションでは、次のオプションがサポートされていますが、将来使用するために予約されており現在は使用できません。サポートされているオプションは、AcceptConnection、ReceiveLowWater、ReceiveTimeout、SendLowWater、SendTimeout、および Type です。これらのオプションの詳細については、「ソケット プログラミング」を参照してください。

この列挙体を使用してソケット オプションを設定するコード例を次に示します。
'Send operations will time-out if confirmation is ' not received within 1000 milliseconds. s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout, 1000) ' The socket will linger for 10 seconds after Socket.Close is called. Dim lingerOption As New LingerOption(True, 10) s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Linger, lingerOption)
// Send operations will time-out if confirmation // is not received within 1000 milliseconds. s.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.SendTimeout, 1000); // The socket will linger for 10 seconds after Socket.Close is called. LingerOption lingerOption = new LingerOption (true, 10); s.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Linger, lingerOption);
// Specifies that send operations will time-out // if confirmation is not received within 1000 milliseconds. s->SetSocketOption( SocketOptionLevel::Socket, SocketOptionName::SendTimeout, 1000 ); // Specifies that the Socket will linger for 10 seconds after Close is called. LingerOption^ lingerOption = gcnew LingerOption( true,10 ); s->SetSocketOption( SocketOptionLevel::Socket, SocketOptionName::Linger, lingerOption );
// Send operations will time-out if confirmation // is not received within 1000 milliseconds. s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout, 1000); // The socket will linger for 10 seconds after Socket.Close is called. LingerOption lingerOption = new LingerOption(true, 10); s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Linger, lingerOption);

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


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