The Labs \ Source Viewer \ SSCLI \ System.Net.Sockets \ SocketOptionName

  1. //------------------------------------------------------------------------------
  2. // <copyright file="SocketOptionName.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. //------------------------------------------------------------------------------
  15. namespace System.Net.Sockets
  16. {
  17.     using System;
  18.    
  19.     //
  20.     // Option names per-socket.
  21.     //
  22.    
  23.     /// <devdoc>
  24.     /// <para>
  25.     /// Defines socket option names for the <see cref='System.Net.Sockets.Socket'/> class.
  26.     /// </para>
  27.     /// </devdoc>
  28.     //UEUE
  29.     public enum SocketOptionName
  30.     {
  31.        
  32.         //
  33.         // good for SocketOptionLevel.Socket
  34.         //
  35.        
  36.         /// <devdoc>
  37.         /// <para>Record debugging information.</para>
  38.         /// </devdoc>
  39.         Debug = 1,
  40.         // turn on debugging info recording
  41.         /// <devdoc>
  42.         /// <para>Socket is listening.</para>
  43.         /// </devdoc>
  44.         AcceptConnection = 2,
  45.         // socket has had listen()
  46.         /// <devdoc>
  47.         /// <para>
  48.         /// Allows the socket to be bound to an address that is already in use.
  49.         /// </para>
  50.         /// </devdoc>
  51.         ReuseAddress = 4,
  52.         // allow local address reuse
  53.         /// <devdoc>
  54.         /// <para>
  55.         /// Send keep-alives.
  56.         /// </para>
  57.         /// </devdoc>
  58.         KeepAlive = 8,
  59.         // keep connections alive
  60.         /// <devdoc>
  61.         /// <para>
  62.         /// Do not route, send directly to interface addresses.
  63.         /// </para>
  64.         /// </devdoc>
  65.         DontRoute = 16,
  66.         // just use interface addresses
  67.         /// <devdoc>
  68.         /// <para>
  69.         /// Permit sending broadcast messages on the socket.
  70.         /// </para>
  71.         /// </devdoc>
  72.         Broadcast = 32,
  73.         // permit sending of broadcast msgs
  74.         /// <devdoc>
  75.         /// <para>
  76.         /// Bypass hardware when possible.
  77.         /// </para>
  78.         /// </devdoc>
  79.         UseLoopback = 64,
  80.         // bypass hardware when possible
  81.         /// <devdoc>
  82.         /// <para>
  83.         /// Linger on close if unsent data is present.
  84.         /// </para>
  85.         /// </devdoc>
  86.         Linger = 128,
  87.         // linger on close if data present
  88.         /// <devdoc>
  89.         /// <para>
  90.         /// Receives out-of-band data in the normal data stream.
  91.         /// </para>
  92.         /// </devdoc>
  93.         OutOfBandInline = 256,
  94.         // leave received OOB data in line
  95.         /// <devdoc>
  96.         /// <para>
  97.         /// Close socket gracefully without lingering.
  98.         /// </para>
  99.         /// </devdoc>
  100.         DontLinger = ~Linger,
  101.         /// <devdoc>
  102.         /// <para>
  103.         /// Enables a socket to be bound for exclusive access.
  104.         /// </para>
  105.         /// </devdoc>
  106.         ExclusiveAddressUse = ~ReuseAddress,
  107.         // disallow local address reuse
  108.         /// <devdoc>
  109.         /// <para>
  110.         /// Specifies the total per-socket buffer space reserved for sends. This is
  111.         /// unrelated to the maximum message size or the size of a TCP window.
  112.         /// </para>
  113.         /// </devdoc>
  114.         SendBuffer = 4097,
  115.         // send buffer size
  116.         /// <devdoc>
  117.         /// <para>
  118.         /// Send low water mark.
  119.         /// </para>
  120.         /// </devdoc>
  121.         ReceiveBuffer = 4098,
  122.         // receive buffer size
  123.         /// <devdoc>
  124.         /// <para>
  125.         /// Specifies the total per-socket buffer space reserved for receives. This is unrelated to the maximum message size or the size of a TCP window.
  126.         /// </para>
  127.         /// </devdoc>
  128.         SendLowWater = 4099,
  129.         // send low-water mark
  130.         /// <devdoc>
  131.         /// <para>
  132.         /// Receive low water mark.
  133.         /// </para>
  134.         /// </devdoc>
  135.         ReceiveLowWater = 4100,
  136.         // receive low-water mark
  137.         /// <devdoc>
  138.         /// <para>
  139.         /// Send timeout.
  140.         /// </para>
  141.         /// </devdoc>
  142.         SendTimeout = 4101,
  143.         // send timeout
  144.         /// <devdoc>
  145.         /// <para>
  146.         /// Receive timeout.
  147.         /// </para>
  148.         /// </devdoc>
  149.         ReceiveTimeout = 4102,
  150.         // receive timeout
  151.         /// <devdoc>
  152.         /// <para>
  153.         /// Get error status and clear.
  154.         /// </para>
  155.         /// </devdoc>
  156.         Error = 4103,
  157.         // get error status and clear
  158.         /// <devdoc>
  159.         /// <para>
  160.         /// Get socket type.
  161.         /// </para>
  162.         /// </devdoc>
  163.         Type = 4104,
  164.         // get socket type
  165.         /// <devdoc>
  166.         /// <para>
  167.         /// Maximum queue length that can be specified by <see cref='System.Net.Sockets.Socket.Listen'/>.
  168.         /// </para>
  169.         /// </devdoc>
  170.         MaxConnections = 2147483647,
  171.         // Maximum queue length specifiable by listen.
  172.        
  173.         //
  174.         // the following values are taken from ws2tcpip.h,
  175.         // note that these are understood only by ws2_32.dll and are not backwards compatible
  176.         // with the values found in winsock.h which are understood by wsock32.dll.
  177.         //
  178.        
  179.         //
  180.         // good for SocketOptionLevel.IP
  181.         //
  182.        
  183.         /// <devdoc>
  184.         /// <para>
  185.         /// IP options.
  186.         /// </para>
  187.         /// </devdoc>
  188.         IPOptions = 1,
  189.         /// <devdoc>
  190.         /// <para>
  191.         /// Header is included with data.
  192.         /// </para>
  193.         /// </devdoc>
  194.         HeaderIncluded = 2,
  195.         /// <devdoc>
  196.         /// <para>
  197.         /// IP type of service and preced.
  198.         /// </para>
  199.         /// </devdoc>
  200.         TypeOfService = 3,
  201.         /// <devdoc>
  202.         /// <para>
  203.         /// IP time to live.
  204.         /// </para>
  205.         /// </devdoc>
  206.         IpTimeToLive = 4,
  207.         /// <devdoc>
  208.         /// <para>
  209.         /// IP multicast interface.
  210.         /// - Additional comments by mbolien:
  211.         /// multicast interface You provide it with an SOCKADDR_IN, and that tells the
  212.         /// system that it should receive multicast messages on that interface (if you
  213.         /// have more than one interface). Binding the socket is not sufficient, since
  214.         /// if the Ethernet hardware isnt set up to grab the multicast packets, it wont
  215.         /// do good to bind the socket. Kinda like raw sockets. Unless you
  216.         /// put the Ethernet card in promiscuous mode, youll only get stuff sent to and
  217.         /// from your machine.
  218.         /// </para>
  219.         /// </devdoc>
  220.         MulticastInterface = 9,
  221.         /// <devdoc>
  222.         /// <para>
  223.         /// IP multicast time to live.
  224.         /// </para>
  225.         /// </devdoc>
  226.         MulticastTimeToLive = 10,
  227.         /// <devdoc>
  228.         /// <para>
  229.         /// IP Multicast loopback.
  230.         /// </para>
  231.         /// </devdoc>
  232.         MulticastLoopback = 11,
  233.         /// <devdoc>
  234.         /// <para>
  235.         /// Add an IP group membership.
  236.         /// </para>
  237.         /// </devdoc>
  238.         AddMembership = 12,
  239.         /// <devdoc>
  240.         /// <para>
  241.         /// Drop an IP group membership.
  242.         /// </para>
  243.         /// </devdoc>
  244.         DropMembership = 13,
  245.         /// <devdoc>
  246.         /// <para>
  247.         /// Don't fragment IP datagrams.
  248.         /// </para>
  249.         /// </devdoc>
  250.         DontFragment = 14,
  251.         /// <devdoc>
  252.         /// <para>
  253.         /// Join IP group/source.
  254.         /// </para>
  255.         /// </devdoc>
  256.         AddSourceMembership = 15,
  257.         /// <devdoc>
  258.         /// <para>
  259.         /// Leave IP group/source.
  260.         /// </para>
  261.         /// </devdoc>
  262.         DropSourceMembership = 16,
  263.         /// <devdoc>
  264.         /// <para>
  265.         /// Block IP group/source.
  266.         /// </para>
  267.         /// </devdoc>
  268.         BlockSource = 17,
  269.         /// <devdoc>
  270.         /// <para>
  271.         /// Unblock IP group/source.
  272.         /// </para>
  273.         /// </devdoc>
  274.         UnblockSource = 18,
  275.         /// <devdoc>
  276.         /// <para>
  277.         /// Receive packet information for ipv4.
  278.         /// </para>
  279.         /// </devdoc>
  280.         PacketInformation = 19,
  281.        
  282.        
  283.         //
  284.         //good for ipv6
  285.         //
  286.        
  287.         HopLimit = 21,
  288.         //IPV6_HOPLIMIT
  289.         //IPv6ProtectionLevel = 23, //IPV6_PROTECTION_LEVEL
  290.        
  291.         // values for ProtectionLevel that may need an enum.
  292.         //#define PROTECTION_LEVEL_UNRESTRICTED 10 /* For peer-to-peer apps */
  293.         //#define PROTECTION_LEVEL_DEFAULT 20 /* Default level */
  294.         //#define PROTECTION_LEVEL_RESTRICTED 30 /* For Intranet apps */
  295.        
  296.        
  297.        
  298.         //
  299.         // good for SocketOptionLevel.Tcp
  300.         //
  301.        
  302.         /// <devdoc>
  303.         /// <para>
  304.         /// Disables the Nagle algorithm for send coalescing.
  305.         /// </para>
  306.         /// </devdoc>
  307.         NoDelay = 1,
  308.         /// <devdoc>
  309.         /// <para>[To be supplied.]</para>
  310.         /// </devdoc>
  311.         BsdUrgent = 2,
  312.         Expedited = 2,
  313.        
  314.        
  315.         //
  316.         // good for SocketOptionLevel.Udp
  317.         //
  318.        
  319.         /// <devdoc>
  320.         /// <para>[To be supplied.]</para>
  321.         /// </devdoc>
  322.         NoChecksum = 1,
  323.         /// <devdoc>
  324.         /// <para>
  325.         /// Udp-Lite checksum coverage.
  326.         /// </para>
  327.         /// </devdoc>
  328.         ChecksumCoverage = 20,
  329.        
  330.         UpdateAcceptContext = 28683,
  331.        
  332.         UpdateConnectContext = 28688
  333.        
  334.     }
  335.     // enum SocketOptionName
  336.    
  337. }
  338. // namespace System.Net.Sockets

Developer Fusion