示例#1
0
        /// <summary>
        /// Internal, do not use :)
        /// </summary>
        internal void Start()
        {
            // ThreadPool.QueueUserWorkItem(_ =>
            // {
            if (!DoHandshake())
            {
                Error?.Invoke(this, new Exception("Handshake Failed."));
                Disconnected?.Invoke(this, this);
                return;
            }

            HandshakeCompleted?.Invoke(this, this);
            StartMessageLoop();
            // });
        }
    /// <summary>
    /// This class handles the last.fm protocol implementations.
    /// </summary>
    static AudioscrobblerBase()
    {
      LoadSettings();
      workerSuccess += new HandshakeCompleted(OnHandshakeSuccessful);
      workerFailed += new HandshakeFailed(OnHandshakeFailed);

      if (_useDebugLog)
      {
        Log.Info("AudioscrobblerBase: new scrobbler for {0} with {1} cached songs - debuglog = {2}", Username,
                 Convert.ToString(queue.Count), Convert.ToString(_useDebugLog));
      }
    }
示例#3
0
 private void OnHandshakeCompleted(HandshakeCompleted data)
 {
     Coordinator?.Connect(data.Connection, data.Handshake);
 }
 protected virtual void OnHandshakeCompleted(HandshakeEventArgs e)
 {
     HandshakeCompleted?.Invoke(this, e);
 }
示例#5
0
        internal void HandleRemoteHandshakeCompletion(Identity remoteIdentity)
        {
            var e = new TcpTransportHandshakeCompletionEventArgs(remoteIdentity);

            HandshakeCompleted?.Invoke(e);
        }
示例#6
0
 protected void OnHandshakeCompleted(BaudRateEventArgs e)
 {
     HandshakeCompleted?.Invoke(this, e);
 }