while((sql_row=mysql_fetch_row(sql_result))!=NULL)
{
user_information_init(&user_info);
if(sql_row[0]!=NULL)
strcpy(user_info.id, sql_row[0]);
if(sql_row[1]!=NULL)
strcpy(user_info.name, sql_row[1]);
if(sql_row[2]!=NULL)
strcpy(user_info.grade, sql_row[2]);
if(sql_row[3]!=NULL)
strcpy(user_info.phone, sql_row[3]);
if(sql_row[4]!=NULL)
strcpy(user_info.email, sql_row[4]);
if(sql_row[5]!=NULL)
strcpy(user_info.homepage, sql_row[5]);
code = 1000;
memset(&buf, 0x00, MAXBUF_SIZE);
memcpy(&buf[0], &code, sizeof(code));
memcpy(&buf[4], &size, sizeof(size));
memcpy(&buf[8], &user_info, sizeof(user_info));
send(cfd, buf, 8+size, 0);
}
while((sql_row=mysql_fetch_row(sql_result))!=NULL)
{
user_information_init(&user_info);
if(sql_row[0]!=NULL)
strcpy(user_info.id, sql_row[0]);
if(sql_row[1]!=NULL)
strcpy(user_info.name, sql_row[1]);
if(sql_row[2]!=NULL)
strcpy(user_info.grade, sql_row[2]);
if(sql_row[3]!=NULL)
strcpy(user_info.phone, sql_row[3]);
if(sql_row[4]!=NULL)
strcpy(user_info.email, sql_row[4]);
if(sql_row[5]!=NULL)
strcpy(user_info.homepage, sql_row[5]);
code = 1000;
memset(&buf, 0x00, MAXBUF_SIZE);
memcpy(&buf[0], &code, sizeof(code));
memcpy(&buf[4], &size, sizeof(size));
memcpy(&buf[8], &user_info, sizeof(user_info));
send(cfd, buf, 8+size, 0);
}
To copy to clipboard, switch view to plain text mode
connect(this, SIGNAL(readyRead()), this, SLOT(receive_slot()));
receive_slot()
{
qDebug("Buddy_Info");
//server send packet 350-360 time
// but i got a 3-5 output message.
//Is it Bug? or What i missed?
}
connect(this, SIGNAL(readyRead()), this, SLOT(receive_slot()));
receive_slot()
{
qDebug("Buddy_Info");
//server send packet 350-360 time
// but i got a 3-5 output message.
//Is it Bug? or What i missed?
}
To copy to clipboard, switch view to plain text mode
Bookmarks