public function __construct(TransportInterface $transport)
{
$this->transport = $transport;
$this->state = static::STATE_PRE_HELLO;
$this->sessionId = Utils::getUniqueId();
$this->realm = null;
$this->sessionStart = new \DateTime();
$this->authenticationDetails = null;
$this->dispatcher = new EventDispatcher();
$this->dispatcher->addRealmSubscriber($this);
}