Skip to content

Add address and hostname about connected client via OPC UA#25

Open
denise-opendaq wants to merge 2 commits into
mainfrom
server_fils_address_and_hostname_in_connected_client_info
Open

Add address and hostname about connected client via OPC UA#25
denise-opendaq wants to merge 2 commits into
mainfrom
server_fils_address_and_hostname_in_connected_client_info

Conversation

@denise-opendaq
Copy link
Copy Markdown
Contributor

server brings the socket from the open62451 library and reads address and hostname of the connected client to use it in creating ConnectedClientInfo

@denise-opendaq denise-opendaq self-assigned this May 15, 2026
@denise-opendaq denise-opendaq added the enhancement New feature or request label May 15, 2026
char hostBuf[NI_MAXHOST] = {};
getnameinfo(reinterpret_cast<struct sockaddr*>(&addr), addrLen,
ipBuf, sizeof(ipBuf), nullptr, 0, NI_NUMERICHOST);
getnameinfo(reinterpret_cast<struct sockaddr*>(&addr), addrLen,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getnameinfo without NI_NUMERICHOST does a blocking reverse DNS lookup. This runs on the OPC UA server's single processing thread, so while DNS is resolving, the server cannot process anything else (no responses to other clients, no new connections). In environments where the connecting IP has no PTR record or DNS is slow, this can stall the server for up to seconds. Additionally, if there is a buggy client in the network that constantly connects to and disconnects from the server, it may cause problems for other clients as well.
@JakaMohorko What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants