internal void CheckConnected()
{
if(closed.Value)
{
throw new ConnectionClosedException();
}
if(!connected.Value)
{
if(!this.userSpecifiedClientID)
{
this.info.ClientId = this.clientIdGenerator.GenerateId();
}
connected.Value = true;
// now lets send the connection and see if we get an ack/nak
if(null == SyncRequest(info))
{
closed.Value = true;
connected.Value = false;
throw new ConnectionClosedException();
}
}
}