8.3A sent request hangs or blocks for a long time

Created on Aug 17, 2026~2 min read

If a long hang or blocking occurs when sending an HTTP remote request, you may be using code like the following to obtain the local machine's IP or MAC address when constructing the request:

cs
var addressList = Dns.GetHostEntry(Dns.GetHostName()).AddressList;

Dns.GetHostName() returns the local host name, while Dns.GetHostEntry(host name) resolves that name through mechanisms such as DNS and NetBIOS. If the host name is not registered in DNS or the DNS server is unreachable, the resolution process waits until the system times out (about 10-15 seconds by default on Windows), causing every request to be blocked.

In this case, use the framework's built-in HttpRemoteUtility utility methods instead. They read the local network interface information directly, with no DNS/NetBIOS lookup at all and an execution time of < 1 millisecond:

cs
// Get the local IPv4 addressvar ip = HttpRemoteUtility.GetLocalIPv4();// Get the local MAC addressvar mac = HttpRemoteUtility.GetLocalMacAddress();

Using the methods above eliminates the long blocking caused by local host name resolution and restores normal HTTP request/response speed.