Example #1
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="Xmpp" /> class.
        /// </summary>
        public Xmpp()
        {
            ILogger log =
                new LoggerConfiguration().MinimumLevel.Debug()
                .WriteTo.RollingFile("Logs\\log-{Date}.txt")
                .CreateLogger();

            Log.Logger = log;

            TagRegistry.AddAssembly(typeof(Xmpp).Assembly);
        }
        /// <summary>
        ///     Builds the client
        /// </summary>
        /// <returns>Client with the options provided</returns>
        public XmppClient Build()
        {
            if (_logManager != null)
            {
                Log.Initialize(_logManager);
            }

            var type     = typeof(XmppClientBuilder);
            var registry = new TagRegistry();

            registry.AddAssembly(type.Assembly);

            return(new XmppClient {
                UseIPv6 = _useIpv6, UseSsl = _useSsl, Registry = registry, Resource = _resource
            });
        }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="XMPP"/> class.
 /// </summary>
 public XMPP()
 {
     TagRegistry.AddAssembly(typeof(XMPP).Assembly);
     Errors.OnError      += OnError;
     ProtocolState.Socket = new AsyncSocket();
 }