@@ -51,17 +51,17 @@ class NodeConnectionManager {
5151 /**
5252 * Time used to establish `NodeConnection`
5353 */
54- public readonly connConnectTime : number ;
54+ public readonly connectionConnectTime : number ;
5555
5656 /**
5757 * Time to live for `NodeConnection`
5858 */
59- public readonly connTimeoutTime : number ;
59+ public readonly connectionTimeoutTime : number ;
6060
6161 /**
6262 * Default timeout for pinging nodes
6363 */
64- public readonly pingTimeout : number ;
64+ public readonly pingTimeoutTime : number ;
6565
6666 /**
6767 * Alpha constant for kademlia
@@ -72,12 +72,12 @@ class NodeConnectionManager {
7272 /**
7373 * Default timeout for reverse hole punching.
7474 */
75- public readonly holePunchTimeout : number ;
75+ public readonly connectionHolePunchTimeoutTime : number ;
7676
7777 /**
7878 * Initial delay between punch packets, delay doubles each attempt.
7979 */
80- public readonly holePunchInitialInterval : number ;
80+ public readonly connectionHolePunchIntervalTime : number ;
8181
8282 protected logger : Logger ;
8383 protected nodeGraph : NodeGraph ;
@@ -118,11 +118,11 @@ class NodeConnectionManager {
118118 crypto,
119119 seedNodes = { } ,
120120 initialClosestNodes = 3 ,
121- connConnectTime = 2000 ,
122- connTimeoutTime = 60000 ,
123- pingTimeout = 2000 ,
124- holePunchTimeout = 4000 ,
125- holePunchInitialInterval = 250 ,
121+ connectionConnectTime = 2000 ,
122+ connectionTimeoutTime = 60000 ,
123+ pingTimeoutTime = 2000 ,
124+ connectionHolePunchTimeoutTime = 4000 ,
125+ connectionHolePunchIntervalTime = 250 ,
126126 logger,
127127 } : {
128128 keyRing : KeyRing ;
@@ -134,11 +134,11 @@ class NodeConnectionManager {
134134 } ;
135135 seedNodes ?: SeedNodes ;
136136 initialClosestNodes ?: number ;
137- connConnectTime ?: number ;
138- connTimeoutTime ?: number ;
139- pingTimeout ?: number ;
140- holePunchTimeout ?: number ;
141- holePunchInitialInterval ?: number ;
137+ connectionConnectTime ?: number ;
138+ connectionTimeoutTime ?: number ;
139+ pingTimeoutTime ?: number ;
140+ connectionHolePunchTimeoutTime ?: number ;
141+ connectionHolePunchIntervalTime ?: number ;
142142 logger ?: Logger ;
143143 } ) {
144144 this . logger = logger ?? new Logger ( NodeConnectionManager . name ) ;
@@ -151,11 +151,11 @@ class NodeConnectionManager {
151151 delete seedNodes [ localNodeIdEncoded ] ;
152152 this . seedNodes = seedNodes ;
153153 this . initialClosestNodes = initialClosestNodes ;
154- this . connConnectTime = connConnectTime ;
155- this . connTimeoutTime = connTimeoutTime ;
156- this . holePunchTimeout = holePunchTimeout ;
157- this . holePunchInitialInterval = holePunchInitialInterval ;
158- this . pingTimeout = pingTimeout ;
154+ this . connectionConnectTime = connectionConnectTime ;
155+ this . connectionTimeoutTime = connectionTimeoutTime ;
156+ this . connectionHolePunchTimeoutTime = connectionHolePunchTimeoutTime ;
157+ this . connectionHolePunchIntervalTime = connectionHolePunchIntervalTime ;
158+ this . pingTimeoutTime = pingTimeoutTime ;
159159 }
160160
161161 public async start ( { nodeManager } : { nodeManager : NodeManager } ) {
@@ -240,7 +240,7 @@ class NodeConnectionManager {
240240 ) ;
241241 connectionAndTimer . timer = new Timer ( {
242242 handler : async ( ) => await this . destroyConnection ( targetNodeId ) ,
243- delay : this . connTimeoutTime ,
243+ delay : this . connectionTimeoutTime ,
244244 } ) ;
245245 }
246246 } ,
@@ -267,7 +267,7 @@ class NodeConnectionManager {
267267 @timedCancellable (
268268 true ,
269269 ( nodeConnectionManager : NodeConnectionManager ) =>
270- nodeConnectionManager . connConnectTime ,
270+ nodeConnectionManager . connectionConnectTime ,
271271 )
272272 public async withConnF < T > (
273273 targetNodeId : NodeId ,
@@ -326,7 +326,7 @@ class NodeConnectionManager {
326326 @timedCancellable (
327327 true ,
328328 ( nodeConnectionManager : NodeConnectionManager ) =>
329- nodeConnectionManager . connConnectTime ,
329+ nodeConnectionManager . connectionConnectTime ,
330330 )
331331 protected async getConnection (
332332 targetNodeId : NodeId ,
@@ -387,7 +387,7 @@ class NodeConnectionManager {
387387 @timedCancellable (
388388 true ,
389389 ( nodeConnectionManager : NodeConnectionManager ) =>
390- nodeConnectionManager . connConnectTime ,
390+ nodeConnectionManager . connectionConnectTime ,
391391 )
392392 protected async getConnectionWithAddress (
393393 targetNodeId : NodeId ,
@@ -606,7 +606,7 @@ class NodeConnectionManager {
606606 const timeToLiveTimer = ! this . isSeedNode ( nodeId )
607607 ? new Timer ( {
608608 handler : async ( ) => await this . destroyConnection ( nodeId ) ,
609- delay : this . connTimeoutTime ,
609+ delay : this . connectionTimeoutTime ,
610610 } )
611611 : null ;
612612 // Add to map
@@ -668,7 +668,7 @@ class NodeConnectionManager {
668668 @timedCancellable (
669669 true ,
670670 ( nodeConnectionManager : NodeConnectionManager ) =>
671- nodeConnectionManager . holePunchTimeout ,
671+ nodeConnectionManager . connectionHolePunchTimeoutTime ,
672672 )
673673 public async holePunchReverse (
674674 host : Host ,
@@ -698,7 +698,7 @@ class NodeConnectionManager {
698698 } ;
699699 ctx . signal . addEventListener ( 'abort' , onAbort ) ;
700700 void ctx . timer . catch ( ( ) => { } ) . finally ( ( ) => onAbort ( ) ) ;
701- let delay = this . holePunchInitialInterval ;
701+ let delay = this . connectionHolePunchIntervalTime ;
702702 // Setting up established event checking
703703 try {
704704 while ( true ) {
@@ -718,21 +718,21 @@ class NodeConnectionManager {
718718 * The connection will be established in the process.
719719 * @param targetNodeId Id of the node we are tying to find
720720 * @param ignoreRecentOffline skips nodes that are within their backoff period
721- * @param pingTimeout timeout for any ping attempts
721+ * @param pingTimeoutTime timeout for any ping attempts
722722 * @param ctx
723723 */
724724 public findNode (
725725 targetNodeId : NodeId ,
726726 ignoreRecentOffline ?: boolean ,
727- pingTimeout ?: number ,
727+ pingTimeoutTime ?: number ,
728728 ctx ?: Partial < ContextTimed > ,
729729 ) : PromiseCancellable < NodeAddress | undefined > ;
730730 @ready ( new nodesErrors . ErrorNodeConnectionManagerNotRunning ( ) )
731731 @timedCancellable ( true )
732732 public async findNode (
733733 targetNodeId : NodeId ,
734734 ignoreRecentOffline : boolean = false ,
735- pingTimeout : number | undefined ,
735+ pingTimeoutTime : number | undefined ,
736736 @context ctx : ContextTimed ,
737737 ) : Promise < NodeAddress | undefined > {
738738 this . logger . debug (
@@ -754,7 +754,7 @@ class NodeConnectionManager {
754754 address = await this . getClosestGlobalNodes (
755755 targetNodeId ,
756756 ignoreRecentOffline ,
757- pingTimeout ?? this . pingTimeout ,
757+ pingTimeoutTime ?? this . pingTimeoutTime ,
758758 ctx ,
759759 ) ;
760760 if ( address != null ) {
@@ -782,22 +782,22 @@ class NodeConnectionManager {
782782 * @param targetNodeId ID of the node attempting to be found (i.e. attempting
783783 * to find its IP address and port)
784784 * @param ignoreRecentOffline skips nodes that are within their backoff period
785- * @param pingTimeout
785+ * @param pingTimeoutTime
786786 * @param ctx
787787 * @returns whether the target node was located in the process
788788 */
789789 public getClosestGlobalNodes (
790790 targetNodeId : NodeId ,
791791 ignoreRecentOffline ?: boolean ,
792- pingTimeout ?: number ,
792+ pingTimeoutTime ?: number ,
793793 ctx ?: Partial < ContextTimed > ,
794794 ) : PromiseCancellable < NodeAddress | undefined > ;
795795 @ready ( new nodesErrors . ErrorNodeConnectionManagerNotRunning ( ) )
796796 @timedCancellable ( true )
797797 public async getClosestGlobalNodes (
798798 targetNodeId : NodeId ,
799799 ignoreRecentOffline : boolean = false ,
800- pingTimeout : number | undefined ,
800+ pingTimeoutTime : number | undefined ,
801801 @context ctx : ContextTimed ,
802802 ) : Promise < NodeAddress | undefined > {
803803 const localNodeId = this . keyRing . getNodeId ( ) ;
@@ -846,7 +846,7 @@ class NodeConnectionManager {
846846 nextNodeAddress . address . port ,
847847 {
848848 signal : ctx . signal ,
849- timer : pingTimeout ?? this . pingTimeout ,
849+ timer : pingTimeoutTime ?? this . pingTimeoutTime ,
850850 } ,
851851 )
852852 ) {
@@ -886,7 +886,7 @@ class NodeConnectionManager {
886886 nodeData . address . port ,
887887 {
888888 signal : ctx . signal ,
889- timer : pingTimeout ?? this . pingTimeout ,
889+ timer : pingTimeoutTime ?? this . pingTimeoutTime ,
890890 } ,
891891 ) )
892892 ) {
@@ -950,7 +950,7 @@ class NodeConnectionManager {
950950 @timedCancellable (
951951 true ,
952952 ( nodeConnectionManager : NodeConnectionManager ) =>
953- nodeConnectionManager . connConnectTime ,
953+ nodeConnectionManager . connectionConnectTime ,
954954 )
955955 public async getRemoteNodeClosestNodes (
956956 nodeId : NodeId ,
@@ -1021,7 +1021,7 @@ class NodeConnectionManager {
10211021 @timedCancellable (
10221022 true ,
10231023 ( nodeConnectionManager : NodeConnectionManager ) =>
1024- nodeConnectionManager . connConnectTime ,
1024+ nodeConnectionManager . connectionConnectTime ,
10251025 )
10261026 public async sendSignalingMessage (
10271027 relayNodeId : NodeId ,
@@ -1085,7 +1085,7 @@ class NodeConnectionManager {
10851085 @timedCancellable (
10861086 true ,
10871087 ( nodeConnectionManager : NodeConnectionManager ) =>
1088- nodeConnectionManager . connConnectTime ,
1088+ nodeConnectionManager . connectionConnectTime ,
10891089 )
10901090 public async relaySignalingMessage (
10911091 message : HolePunchRelayMessage ,
@@ -1147,7 +1147,7 @@ class NodeConnectionManager {
11471147 @timedCancellable (
11481148 true ,
11491149 ( nodeConnectionManager : NodeConnectionManager ) =>
1150- nodeConnectionManager . pingTimeout ,
1150+ nodeConnectionManager . pingTimeoutTime ,
11511151 )
11521152 public async pingNode (
11531153 nodeId : NodeId ,
0 commit comments