我发现了一个类似的问题:
如何识别线程A的名称或任何上下文信息当它中断线程B?Every thread has a name for identification purposes.If a name is not specified when a thread is created, a new name is generated for it.Does 时,即使我们得到线程A的名称,也有可能有多个具有与这里提到的名称相同的线程: --这意味着我必须创建自定义
我使用java API进行DNS查询: 1/ java.net.InetSocketAddress.InetSocketAddress(String,int) -名称查找2/ java.net.InetAddress.getByName(字符串)-名称查找3/ java.net.InetAddress.getHostName() -反向名称查找public class Ip