public void Start(string peerId) { if (IsConnected) { throw new InvalidOperationException("Already started"); } CheckOnlyStartedOnce(); _receiveCompletionProcessor.Start(); _sendRequestProcessingEngine.Start(); _socket = CreateSocket(); _session.Open(_socket); Connect(_socket, _serverEndpoint); _session.InitiateReceiving(); Handshake(peerId); IsConnected = true; Connected?.Invoke(); }
public void Start(string peerId) { if (IsRunning) { throw new InvalidOperationException("Already started"); } CheckOnlyStartedOnce(); _receiveCompletionProcessor.Start(); _sendRequestProcessingEngine.Start(); StartListening(); IsRunning = true; }