瀏覽代碼

fixed debug mesasge of the network layer - showing the remote socket and not the own one

Stasik0 8 年之前
父節點
當前提交
e14b5a3c50
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      plugins/networklayer_tcp.c

+ 1 - 1
plugins/networklayer_tcp.c

@@ -305,7 +305,7 @@ ServerNetworkLayerTCP_add(ServerNetworkLayerTCP *layer, UA_Int32 newsockfd) {
 
     struct sockaddr_in addr;
     socklen_t addrlen = sizeof(struct sockaddr_in);
-    getsockname(newsockfd, (struct sockaddr*)&addr, &addrlen);
+    getpeername(newsockfd, (struct sockaddr*)&addr, &addrlen);
     UA_LOG_INFO(layer->logger, UA_LOGCATEGORY_NETWORK, "New Connection %i over TCP from %s:%d",
                 newsockfd, inet_ntoa(addr.sin_addr), ntohs(addr.sin_port));
     UA_Connection_init(c);