示例#1
0
        public void Start(string peerId)
        {
            _receiveCompletionProcessor.Start();
            _requestProcessingEngine.Start();

            StartListening();
        }
示例#2
0
        public void Start(string peerId)
        {
            if (IsConnected)
            {
                throw new InvalidOperationException("Already started");
            }

            _receiveCompletionProcessor.Start();
            _requestProcessingEngine.Start();

            var socket = CreateSocket();

            _session.Open(socket);

            Connect(socket, _serverEndpoint);

            _session.InitiateReceiving(_requestProcessingEngine);

            Handshake(peerId);

            IsConnected = true;

            Connected?.Invoke();
        }