Skip to content

Commit f463fd5

Browse files
committed
Graceful Peer Timeout for debugging purposes
Signed-off-by: Mikhail Agapov <mikhail.agapov@decentraland.org>
1 parent a150324 commit f463fd5

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

src/DCLPulse/Transport/ENetHostedService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ private void HandleEvent(ref Event netEvent)
116116
switch (netEvent.Type)
117117
{
118118
case EventType.Connect:
119+
netEvent.Peer.Timeout(0, options.PeerTimeoutMs, options.PeerTimeoutMs);
119120
connectedPeers[peerIndex] = netEvent.Peer;
120121

121122
messagePipe.OnPeerConnected(peerIndex);

src/DCLPulse/Transport/ENetTransportOptions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ public sealed class ENetTransportOptions
88
public int MaxPeers { get; set; } = 4095;
99
public int ServiceTimeoutMs { get; set; } = 1000;
1010
public int BufferSize { get; set; } = 4096;
11+
12+
public uint PeerTimeoutMs { get; set; } = 30000;
1113
}

src/DCLPulse/appsettings.Development.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"Microsoft.Hosting.Lifetime": "Information"
66
}
77
},
8+
"Transport": {
9+
"PeerTimeoutMs": 300000
10+
},
811
"Peers": {
912
"SelfMirrorEnabled": true,
1013
"SelfMirrorTier": 0

0 commit comments

Comments
 (0)