Summary

Class:CBAM.NATS.Implementation.ClientProtocolPoolInfo
Assembly:CBAM.NATS.Implementation
File(s):/repo-dir/contents/Source/Code/CBAM.NATS.Implementation/ConnectionCreation.cs
Covered lines:7
Uncovered lines:2
Coverable lines:9
Total lines:62
Line coverage:77.7%

Coverage History

Metrics

MethodCyclomatic complexity NPath complexity Sequence coverage Branch coverage
.ctor(...)101%0%
ResetCancellationToken()101%0%

File(s)

/repo-dir/contents/Source/Code/CBAM.NATS.Implementation/ConnectionCreation.cs

#LineLine coverage
 1/*
 2 * Copyright 2018 Stanislav Muhametsin. All rights Reserved.
 3 *
 4 * Licensed  under the  Apache License,  Version 2.0  (the "License");
 5 * you may not use  this file  except in  compliance with the License.
 6 * You may obtain a copy of the License at
 7 *
 8 *   http://www.apache.org/licenses/LICENSE-2.0
 9 *
 10 * Unless required by applicable law or agreed to in writing, software
 11 * distributed  under the  License is distributed on an "AS IS" BASIS,
 12 * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
 13 * implied.
 14 *
 15 * See the License for the specific language governing permissions and
 16 * limitations under the License.
 17 */
 18using CBAM.Abstractions.Implementation;
 19using Newtonsoft.Json.Linq;
 20using System;
 21using System.Collections.Generic;
 22using System.IO;
 23using System.Linq;
 24using System.Net;
 25using System.Text;
 26using System.Threading;
 27using System.Threading.Tasks;
 28using UtilPack;
 29
 30namespace CBAM.NATS.Implementation
 31{
 32
 33   internal sealed class ClientProtocolPoolInfo : PooledConnectionFunctionality
 34   {
 35
 36      private Object _cancellationToken;
 37
 438      public ClientProtocolPoolInfo( ClientProtocol protocol )
 39      {
 40         //this.Socket = ArgumentValidator.ValidateNotNull( nameof( socket ), socket );
 441         this.Protocol = ArgumentValidator.ValidateNotNull( nameof( protocol ), protocol );
 442      }
 43
 844      public ClientProtocol Protocol { get; }
 45
 46      //public Socket Socket { get; }
 47
 48      public CancellationToken CurrentCancellationToken
 49      {
 050         get => (CancellationToken) this._cancellationToken;
 851         set => Interlocked.Exchange( ref this._cancellationToken, value );
 52      }
 53
 054      public Boolean CanBeReturnedToPool => this.Protocol.CanBeReturnedToPool;
 55
 56      public void ResetCancellationToken()
 57      {
 858         this._cancellationToken = null;
 859      }
 60   }
 61
 62}