Example #1
0
 private void ConnectionClosed(object sender, ConnectionClosedEventArgs e)
 {
     log.Info("TpsService: Connection is Closed.");
     TpsConnectionClosed?.Invoke();
     peer?.Dispose();
     peer = null;
     awaitaiblePeer?.Dispose();
     awaitaiblePeer = null;
 }
Example #2
0
        public async Task ConnectAsync()
        {
            var connected = false;

            do
            {
                try
                {
                    log.Debug("TpsService: Trying to re-connect until connection is established.");
                    awaitaiblePeer = await awaitaibleClient.ConnectAsync();

                    connected = true;
                }
                catch
                {
                    log.Debug("TpsService: Trying to connect but failed and wait for 2s.");
                    await Task.Delay(2000); // Todo: take retry time value from config or use Poly
                }
            } while (!connected);
        }
 public AddingTcpFrameToFrameBufferFailedEventArgs(IAwaitaibleRemoteTcpPeer awaitaibleRemoteTcpPeer, byte[] frameData)
 {
     this.AwaitaibleRemoteTcpPeer = awaitaibleRemoteTcpPeer;
     this.FrameData = frameData;
 }