|
@@ -23,11 +23,13 @@ internal class DevServerApp(
|
|
|
logger.LogInformation("init");
|
|
|
eventBus.Subscript<TrustedPeerManager.TPM_EVT_PEER_IX>(OnIncome);
|
|
|
eventBus.Subscript<TrustedPeerManager.TPM_EVT_PEER_RX>(OnRx);
|
|
|
+ eventBus.Subscript<TrustedPeerManager.TPM_EVT_PEER_DX>(OnDx);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
public void Start()
|
|
|
{
|
|
|
logger.LogInformation("starting...");
|
|
@@ -73,7 +75,6 @@ internal class DevServerApp(
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
-
|
|
|
await _tcpServer.StartAsync();
|
|
|
}
|
|
|
catch (Exception e)
|
|
@@ -88,6 +89,7 @@ internal class DevServerApp(
|
|
|
logger.LogInformation("Income:" + obj.PeerId);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
private void OnRx(TrustedPeerManager.TPM_EVT_PEER_RX obj)
|
|
|
{
|
|
|
logger.LogInformation($"Rx from <{obj.PeerId}>");
|
|
@@ -95,6 +97,10 @@ internal class DevServerApp(
|
|
|
tpm.SendToPeer(obj.PeerId, SHA256.HashData(obj.block));
|
|
|
}
|
|
|
|
|
|
+ private void OnDx(TrustedPeerManager.TPM_EVT_PEER_DX obj)
|
|
|
+ {
|
|
|
+ logger.LogInformation("Disconnected:" + obj.PeerId);
|
|
|
+ }
|
|
|
|
|
|
public void Stop()
|
|
|
{
|