public void Login()
{
//"$this->device-$this->whatsAppVer-$this->port";
string resource = string.Format(@"{0}-{1}-{2}",
WhatsConstants.IphoneDevice,
WhatsConstants.WhatsAppVer,
WhatsConstants.WhatsPort);
var data = this.writer.StartStream(WhatsConstants.WhatsAppServer, resource);
var feat = this.addFeatures();
var auth = this.addAuth();
this.whatsNetwork.SendData(data);
this.whatsNetwork.SendNode(feat);
this.whatsNetwork.SendNode(auth);
this.PollMessages();
ProtocolTreeNode authResp = this.addAuthResponse();
this.whatsNetwork.SendNode(authResp);
int cnt = 0;
do
{
this.PollMessages();
} while ((cnt++ < 100) &&
(this.loginStatus.Equals(this.disconnectedStatus, StringComparison.OrdinalIgnoreCase)));
}