From 3b8b6d76427c972c95813f7842ea19374493f022 Mon Sep 17 00:00:00 2001 From: hwzhangchuang Date: Wed, 3 Jan 2024 10:42:21 +0800 Subject: [PATCH] modify Signed-off-by: hwzhangchuang --- .../transportbase/src/distributed_input_transport_base.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/transportbase/src/distributed_input_transport_base.cpp b/services/transportbase/src/distributed_input_transport_base.cpp index 06a021f..698be02 100644 --- a/services/transportbase/src/distributed_input_transport_base.cpp +++ b/services/transportbase/src/distributed_input_transport_base.cpp @@ -207,9 +207,10 @@ std::string DistributedInputTransportBase::GetDevIdBySessionId(int32_t sessionId int32_t DistributedInputTransportBase::CreateClientSocket(const std::string &remoteDevId) { DHLOGI("CreateClientSocket start, peerNetworkId: %s", remoteDevId.c_str()); + std::string localSesionName = localSessionName_ + "_" + std::to_string(GetCurrentTimeUs()); std::string peerSessionName = SESSION_NAME + remoteDevId.substr(0, INTERCEPT_STRING_LENGTH); SocketInfo info = { - .name = const_cast(localSessionName_.c_str()), + .name = const_cast(localSesionName.c_str()), .peerName = const_cast(peerSessionName.c_str()), .peerNetworkId = const_cast(remoteDevId.c_str()), .pkgName = const_cast(DINPUT_PKG_NAME.c_str()), @@ -217,7 +218,7 @@ int32_t DistributedInputTransportBase::CreateClientSocket(const std::string &rem }; int32_t socket = Socket(info); DHLOGI("Bind Socket server, socket: %d, localSessionName: %s, peerSessionName: %s", - socket, localSessionName_.c_str(), peerSessionName.c_str()); + socket, localSesionName.c_str(), peerSessionName.c_str()); return socket; } -- Gitee