code: protected synchronized void setConnection (PresentsConnection conn)
      {
          long now = System.currentTimeMillis();
          if (_conn != null) {
              // if our connection is being cleared out, record the amount of time we were connected
              // to our total connected time
              if (conn == null) {
                  _connectTime += ((now - _networkStamp) / 1000);
                  _messagesDropped = 0;
              }
  
              // make damn sure we don't get any more messages from the old connection
              _conn.clearMessageHandler();
          }
  
          // keep a handle to the new connection
          _conn = conn;
  
          // if we're setting a connection rather than clearing one out...
          if (_conn != null) {
              // tell the connection to pass messages on to us
              _conn.setMessageHandler(this);
  
              // configure any active custom class loader
              if (_loader != null) {
                  _conn.setClassLoader(_loader);
              }
          }
  
          // make a note that our network status changed
          _networkStamp = now;
      }
docs: Sets our connection reference in a thread safe way. Also establishes the back reference to
  us as the connection's message handler.