|  | 
          Establish a connection with a server. Syntax
          object.Connect( [RemoteAddress],
          [RemotePort], [Protocol], [Timeout],
          [Options], [LocalAddress], [LocalPort] ) Parameters
          
            RemoteAddressAn optional string value that specifies the host name or IP address 
            of the server. If this parameter is omitted, it
          defaults to the value of the HostAddress property if it is
          defined; otherwise, it defaults to the value of the HostName 
            property.RemotePortAn optional integer value that specifies the port number that 
            the server is using to listen for connections. If this parameter is 
            omitted, the RemotePort property will be used to 
            determine the default value.ProtocolAn an optional integer value that specifies the protocol that 
            should be used when establishing the connection. If this parameter 
            is omitted, the
          Protocol property will be used to determine the default value. It may be one of 
            the following values: 
          
            
              
                | Value | Constant | Description |  
                | 6 | swProtocolTcp | The connection will use the Transmission Control Protocol.
                This protocol provides a reliable means of communication between
                two computers using a client/server architecture. The data is
                exchanged as a stream of bytes, with the protocol ensuring that
                the data arrives in the same byte order that it was sent,
                without duplication or missing data. This protocol is designed
                for accuracy and not speed, therefore TCP can sometimes incur
                relatively long delays while waiting for out-of-order packets
                and the retransmission of data which can make it unsuitable for
                some applications such as streaming video or audio. |  
                | 17 | swProtocolUdp | The connection will use the User Datagram Protocol. This is
                a stateless, peer-to-peer message oriented protocol, with the data
                sent in discrete packets. UDP is a simpler network protocol that
                does not have the inherent reliability of TCP, but it has less
                overhead and is ideal for real-time applications where a dropped
                packet is preferable to the delay of waiting for a packet to be
                acknowledged or retransmitted. It also supports the broadcasting
                of datagrams over local networks, and is commonly used by
                services that must exchange a relatively small amount of data
                with a large number of clients. |  
          
            TimeoutAn optional integer value that specifies the amount of time until
            a blocking operation fails. If this parameter is omitted, the
            Timeout property will be used to determine the default value.OptionsAn optional integer value that specifies one or more socket 
            options which are to be used when establishing the connection. The 
            value is created by combining the options using a bitwise Or 
            operator. Note that if this argument is specified, it will override 
            any property values that are related to that option. 
          
            
              
                | 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. |  
          
            LocalAddressAn optional string value that specifies the local IP address of 
            the network adapter that the control should use when establishing 
            the connection. If this parameter is omitted, the control will bind 
            to any suitable adapter on the local system. It is recommended that 
            you omit this parameter when establishing a TCP connection unless 
            you fully understand the implications of binding the socket to a 
            specific local address.LocalPortAn optional integer value that specifies the local port number 
            that the control should use when establishing the connection. If 
            this argument is not specified, an appropriate local port number 
            will be automatically allocated for the connection. It is 
            recommended that you omit this parameter when establishing a TCP 
            connection unless you fully understand the implications of binding 
            the socket to a specific local port. Return Value
          A value of zero is returned if the connection was successful.
          Otherwise, a non-zero error code is returned which indicates the
          cause of the failure. See Also
          
            HostName Property,
            KeepAlive Property, 
            NoDelay Property, 
            Options Property, 
            RemotePort Property, 
            ReuseAddress Property, 
            Route Property, 
            Secure Property, 
            SecureProtocol Property, 
            Timeout Property, 
            Bind Method,
            Disconnect Method,
            OnConnect Event,
            OnDisconnect Event |  |