Skip to content

Commit

Permalink
opt: use qtcpsocket signal to implement the dictserver protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyifang committed Dec 26, 2023
1 parent 5dd3801 commit 27b430e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dict/dictserver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ void DictServerArticleRequest::run()
connect( &dictImpl->socket, &QTcpSocket::readyRead, this, [ this ]() {
if ( state == DictServerState::DEFINE ) {
QByteArray reply = dictImpl->socket.readLine();
qDebug() << "receive:" << reply;
qDebug() << "receive define:" << reply;

auto code = reply.left( 3 );
if ( reply.left( 3 ) != "150" ) {
Expand Down Expand Up @@ -700,7 +700,7 @@ void DictServerArticleRequest::run()
}
else if ( state == DictServerState::DEFINE_DATA ) {
QByteArray reply = dictImpl->socket.readLine();
qDebug() << "receive:" << reply;
qDebug() << "receive define data:" << reply;
while ( true ) {
if ( reply.isEmpty() )
return;
Expand Down

0 comments on commit 27b430e

Please sign in to comment.