QTcpServer
という名前のスケルトンがサブクラス化されたサーバーアプリケーションに取り組んでいますUeTcpServer
。サーバーアプリは正常に起動し、にブレークポイントを配置すると、経由ueSlotTcpServerNewConnection()
で接続されUeTcpServer
ますnewConnectionSignal
connect(this->ueTcpServer(),
SIGNAL(newConnection()),
this,
SLOT(ueSlotTcpServerNewConnection()));
を使用してサーバーアプリに接続すると、スロットLinux terminal
内でブレークポイントがアクティブになります。ueSlotTcpServerNewConnection()
void UeMainWindow::ueSlotTcpServerNewConnection()
{
if(this->ueTcpServer()->hasPendingConnections())
{
QTcpSocket* incomingSocket=this->ueTcpServer()->nextPendingConnection();
this->ueSlotAddEventInfoLog(0,
tr("New incoming connection from host")
.append(" ")
//.append(this->ueTcpServer()->nextPendingConnection()->peerAddress().toString())
.append(incomingSocket->peerName())
.append(" ")
.append(tr("with IP address"))
.append(" ")
.append(incomingSocket->peerAddress().toString())
.append(" ")
.append(tr("using port"))
.append(" ")
//.append(this->ueTcpServer()->nextPendingConnection()->peerPort()));
.append(QString::number(incomingSocket->peerPort())));
} // if
} // ueSlotTcpServerNewConnection
ただし、this->ueTcpServer()->hasPendingConnection()
返品しますfalse
。なんで?