/// <summary>
 /// Completely obliterate a spinner. It will just no longer exist. Use this when
 /// you need absolute destruction.
 /// </summary>
 /// <param name="spinner">Spinner.</param>
 private void ObliterateSpinner(WebSocketSpinner spinner)
 {
    Log("Forcefully obliterating spinner: " + spinner.ID, LogLevel.Debug);
    spinner.Stop();
    RemoveSpinner(spinner);
 }
      /// <summary>
      /// The worker function which should be run on a thread. It accepts connections
      /// </summary>
      protected override void Spin()
      {
         spinnerStatus = SpinStatus.Starting;
         TcpListener server = new TcpListener(System.Net.IPAddress.Any, settings.Port);

         try
         {
            server.Start();
         }
         catch(Exception e)
         {
            Log("Couldn't start accept spinner: " + e.Message, LogLevel.FatalError);
            spinnerStatus = SpinStatus.Error;
            return;
         }

         Log("Started server on port: " + settings.Port);
         spinnerStatus = SpinStatus.Spinning;

         while (!shouldStop)
         {
            //NO! NO BLOCKING! This is basically nonblocking... kind of.
            if (server.Pending())
            {
               //Accept the client and set it up
               try
               {
                  TcpClient client = server.AcceptTcpClient();
                  client.ReceiveBufferSize = settings.ReceiveBufferSize;
                  client.SendBufferSize = settings.SendBufferSize;
                  client.SendTimeout = client.ReceiveTimeout = (int)settings.ReadWriteTimeout.TotalMilliseconds;
                  WebSocketClient webClient = new WebSocketClient(client, settings.MaxReceiveSize);

                  //Start up a spinner to handle this new connection. The spinner will take care of headers and all that,
                  //we're just here to intercept new connections.
                  WebSocketSpinner newSpinner = new WebSocketSpinner(webClient, GenerateNewUser(), settings);
                  newSpinner.OnComplete += RemoveSpinner;

                  Log("Accepted connection from " + client.Client.RemoteEndPoint);
                  lock (spinnerLock)
                  {
                     connectionSpinners.Add(newSpinner);
                  }

                  if (!newSpinner.Start())
                  {
                     Log("Couldn't startup client spinner!", LogLevel.Error);
                     ObliterateSpinner(newSpinner);
                  }
               }
               catch(Exception e)
               {
                  Log("Encountered exception while accepting: " + e, LogLevel.Error);
               }
            }

            System.Threading.Thread.Sleep((int)settings.AcceptPollInterval.TotalMilliseconds);
         }

         Log("Attempting to stop server", LogLevel.Debug);

         server.Stop();

         foreach (WebSocketSpinner spinner in new List<WebSocketSpinner>(connectionSpinners))
            ObliterateSpinner(spinner);

         Log("Server shut down");
         spinnerStatus = SpinStatus.Complete;
      }