24,854
社区成员
发帖
与我相关
我的任务
分享
void TcpConnect::sendMessage()
{
//试发头部信息
VideoHead video_head;
video_head.set_type(1);
video_head.set_fps(29);
video_head.set_numframe(100);
char c_head[100];
memset(c_head,'0',sizeof(c_head));
video_head.SerializePartialToArray(c_head,100);
tcp_socket->write(c_head,100);
tcp_socket->flush();
if(!tcp_socket->waitForBytesWritten(3000))
{
QMessageBox::about(NULL,"Tcp error","send error!");
}
qDebug() << tcp_socket->state() << endl;
}