简体   繁体   English

使用Java检索基于HttpConnection的本地IP地址

[英]Retrieving the local IP address based on HttpConnection using Java

当用于创建连接的类是HttpUrlConnection时,有什么方法可以确定用于创建HTTP连接的套接字的IP地址吗?

No, sorry, the HttpURLConnection is an abstract class. 不,对不起,HttpURLConnection是一个抽象类。 The actual connection is implemented in code provided by the JRE. 实际的连接是通过JRE提供的代码实现的。 As such, there are no methods that will give you access to the actual Socket used. 因此,没有任何方法可以让您访问实际使用的Socket。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM