Options Property  
 

Gets and sets the options that are used in establishing a connection.

Syntax

object.Options [= value ]

Remarks

The Options property is an integer value which specifies one or more options. The value specified for this property will be used as the default options when connecting to the server. The property value is created by using a bitwise operator with one or more of the following values:

Value Constant Description
1 swOptionBroadcast This option specifies that broadcasting should be enabled for datagrams. This option is invalid for stream sockets.
2 swOptionDontRoute This option specifies default routing should not be used. This option should not be specified unless absolutely necessary.
4 swOptionKeepAlive This option specifies that packets are to be sent to the remote system when no data is being exchanged to keep the connection active. This is only valid for stream sockets.
&H10 swOptionNoDelay This option disables the Nagle algorithm. By default, small amounts of data written to the socket are buffered, increasing efficiency and reducing network congestion. However, this buffering can negatively impact the responsiveness of certain applications. This option disables this buffering and immediately sends data packets as they are written to the socket.
&H20 swOptionInLine This option specifies that out-of-band data should be received inline with the standard data stream. This option is only valid for stream sockets.
&H800 swOptionTrustedSite This option specifies the server is trusted. The server certificate will not be validated and the connection will always be permitted. This option only affects connections using either the SSL or TLS protocols.
&H1000 swOptionSecure This option specifies that a secure connection should be established with the remote host. The specific version of TLS can be specified by setting the SecureProtocol property. By default, the connection will use TLS 1.2 and the strongest cipher suites available. Older versions of Windows prior to Windows 7 and Windows Server 2008 R2 only support TLS 1.0 and secure connections will automatically downgrade on those platforms.
&H8000 swOptionSecureFallback This option specifies the client should permit the use of less secure cipher suites for compatibility with legacy servers. If this option is specified, the client will allow connections using TLS 1.0 and cipher suites that use RC4, MD5 and SHA1.
&H40000 swOptionPreferIPv6 This option specifies the client should prefer the use of IPv6 if the server hostname can be resolved to both an IPv6 and IPv4 address. This option is ignored if the local system does not have IPv6 enabled, or when the hostname can only be resolved to an IPv4 address. If the server hostname can only be resolved to an IPv6 address, the client will attempt to establish a connection using IPv6 regardless if this option has been specified.

Several of these options correspond to Boolean properties which can be used to enable or disable specific functionality. For example, setting the Secure to True is the same as specifying the swOptionSecure option. We generally recommend setting individual properties when they are available, or explicitly specifying the required options when calling the Connect method.

Data Type

Integer (Int32)

See Also

Broadcast Property, InLine Property, NoDelay Property, Secure Property, SecureProtocol Property, Connect Method