[cli] add OutputSockAddr() method (#7121)

This commit is contained in:
Abtin Keshavarzian
2021-11-01 09:24:50 -07:00
committed by GitHub
parent ba08ed6f34
commit 60aa8b4fb9
6 changed files with 46 additions and 19 deletions
+6 -7
View File
@@ -475,7 +475,7 @@ void TcpExample::HandleTcpDisconnected(otTcpEndpoint *aEndpoint, otTcpDisconnect
mEndpointConnected = false;
mSendBusy = false;
// Mark the benchmark as inactive if the connction was disconnected.
// Mark the benchmark as inactive if the connection was disconnected.
if (mBenchmarkBytesTotal != 0)
{
mBenchmarkBytesTotal = 0;
@@ -491,9 +491,9 @@ otTcpIncomingConnectionAction TcpExample::HandleTcpAcceptReady(otTcpListener *
if (mEndpointConnected)
{
OutputFormat("TCP: Ignoring incoming connection request from [");
OutputIp6Address(aPeer->mAddress);
OutputLine("]:%u (active socket is busy)", static_cast<unsigned int>(aPeer->mPort));
OutputFormat("TCP: Ignoring incoming connection request from ");
OutputSockAddr(*aPeer);
OutputLine(" (active socket is busy)");
return OT_TCP_INCOMING_CONNECTION_ACTION_DEFER;
}
@@ -507,9 +507,8 @@ void TcpExample::HandleTcpAcceptDone(otTcpListener *aListener, otTcpEndpoint *aE
OT_UNUSED_VARIABLE(aListener);
OT_UNUSED_VARIABLE(aEndpoint);
OutputFormat("Accepted connection from [");
OutputIp6Address(aPeer->mAddress);
OutputLine("]:%u", static_cast<unsigned int>(aPeer->mPort));
OutputFormat("Accepted connection from ");
OutputSockAddrLine(*aPeer);
}
} // namespace Cli