public void Start() { Stop(); _stopTokenSource = new CancellationTokenSource(1000); // connect to peers ConnectToPeers(); // listen for peers _peerListener.Start(); }
/// <inheritdoc /> public void Start() { if (_isRunning) { throw new InvalidOperationException("The server is running. To start it again please stop it before."); } _messageListenerTokenSource = new CancellationTokenSource(); // connect to peers ConnectToPeers(_peerEndPoints); // listen for peers _peerListener.Start(); _isRunning = true; }
public void Setup() { listener = new PeerListener(endpoint); listener.Start(); }