void login_page::send_packet()
{
loginClientData login;
//head
char headbuf[100]={0}; //100 包头定长100
bzero(headbuf,100);
dataHead head;
strcpy(head.id_code,"!#360#!");
head.type= 1;
head.size = sizeof(login)+100;
head.CrCheck = 5555;
memcpy(headbuf,&head,sizeof(headbuf));
//body
cout<<"name"<<ui->lineEdit->text().toStdString().c_str()<<MD5Pwd.toStdString().c_str()<<endl;
strcpy(login.userName,ui->lineEdit->text().toStdString().c_str());
strcpy(login.userPwd,MD5Pwd.toStdString().c_str());
strcpy(login.id_code,"#^360^#");
/**********************上面 no problem**********************/
//buffer = head+body
char *buffer = (char *)malloc(1124);
// unsigned char buffer[1124]={0};
bzero(buffer,1124);
cout<<"lenbuffer"<<buffer<<sizeof(buffer)<<endl; // 64 size 8
memcpy(buffer,&head,100);
memcpy(buffer+100,&login,sizeof(login));
loginClientData login_p;
memcpy(&login_p,buffer+100,sizeof(loginClientData));
cout<<"name pwd"<<login_p.userName<<login_p.userPwd<<endl;
socketobj->send_data(buffer,100+sizeof(login));
}