//public MailConnection() { } /// <summary> /// Construct a connection object from parameters. /// </summary> /// <param name="Server">DNS service name</param> /// <param name="Port">IP Port number</param> /// <param name="AppProtocol">Application protocol prefix.</param> /// <param name="Account">Account name for authenticaiton</param> /// <param name="Password">Password for authenticaiton</param> /// <param name="TLSMode">TLS Mode, may be Raw, Upgrade or None.</param> /// <param name="SecureAuth">If true, a /// secure authentication mechanism must be used.</param> public Connection(string Server, int Port, AppProtocol AppProtocol, string Account, string Password, TLSMode TLSMode, bool SecureAuth) { this.ServiceName = Server; this.Port = Port; this.AppProtocol = AppProtocol; this.UserName = Account; this.Password = Password; this.TLSMode = TLSMode; this.SecureAuth = SecureAuth; }
/// <summary> /// Initializes a new instance of the XmppCore class. /// </summary> /// <param name="hostname">The hostname of the XMPP server to connect to.</param> /// <param name="port">The port number of the XMPP service of the server.</param> /// <param name="tls">If true the session will be TLS/SSL-encrypted if the server /// supports TLS/SSL-encryption.</param> /// <param name="validate">A delegate used for verifying the remote Secure Sockets /// Layer (SSL) certificate which is used for authentication. Can be null if not /// needed.</param> /// <exception cref="ArgumentNullException">The hostname parameter is /// null.</exception> /// <exception cref="ArgumentException">The hostname parameter is the empty /// string.</exception> /// <exception cref="ArgumentOutOfRangeException">The value of the port parameter /// is not a valid port number.</exception> public XmppCore(string hostname, int port = 5222, TLSMode tls = TLSMode.StartTLS, RemoteCertificateValidationCallback validate = null) { moveNextSrvDNS(hostname); if (dnsCurrent != null) { Hostname = dnsCurrent.Target.ToString(); Port = dnsCurrent.Port; } else { Hostname = hostname; Port = port; } Tls = tls; Validate = validate; }