Example #1
0
        /// <summary>
        /// Opens the underlying connection.
        /// </summary>
        /// <param name="transport"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        protected async ValueTask <StompConnection> OpenAsync(StompTransport transport, CancellationToken cancellationToken)
        {
            var connection = new StompConnection(transport, options, logger);
            await connection.OpenAsync(cancellationToken);

            await connection.ConnectAsync(null, null, null, null, cancellationToken);

            return(connection);
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="transport"></param>
 /// <param name="options"></param>
 /// <param name="logger"></param>
 public StompConnection(StompTransport transport, StompConnectionOptions options, ILogger logger)
 {
     this.transport = transport ?? throw new ArgumentNullException(nameof(transport));
     this.options   = options ?? throw new ArgumentNullException(nameof(options));
     this.logger    = logger ?? throw new ArgumentNullException(nameof(logger));
 }