connect(m_pSocket,SIGNAL(readyRead()),this,SLOT(getCommand()));
void RunThread::getCommand(){ quint16 blockSize=0; while(m_pSocket->bytesAvailable()<(int)sizeof(quint16)){ if(m_pSocket->waitForReadyRead(1000)){ emit socketReadError(m_pSocket->errorString()); } }
QDataStream in(m_pSocket); in.setVersion(QDataStream::Qt_5_0); in>>blockSize;
qDebug()<<(int)blockSize; }
客户端发送数据块(狂点击)后 服务端收取数据的时候为什么块的大小会这样变呀?????输出结果(服务端) (这个42估计才是准确值哦)
[font='Courier']调试开始
[font='Courier']42
[font='Courier']10000
[font='Courier']0
[font='Courier']38
[font='Courier']24931
[font='Courier']25455
[font='Courier']30062
[font='Courier']29754
[font='Courier']29793
[font='Courier']28263
[font='Courier']25185
[font='Courier']28466
[font='Courier']12339
[font='Courier']9840
[font='Courier']24947
[font='Courier']29559
[font='Courier']28530
[font='Courier']25658
[font='Courier']12600
[font='Courier']14129
[font='Courier']13623
[font='Courier']13360
[font='Courier']12849
[font='Courier']42
[font='Courier']10000
[font='Courier']0
[font='Courier']38
[font='Courier']24931
[font='Courier']25455
[font='Courier']30062
[size=; font-size:10pt,10pt][font='Courier']29754
[size=; font-size:10pt,10pt][font='Courier']29793