public class InetAddressClassReplacement extends Object implements MethodReplacementClass
with socket connection, it will first do host lookup with java.net.InetAddress#getByName if it does not exist, UnknownHostException will be thrown, then the `socket.connect` cannot be reached. in order to make it connected, we could do replacement for 1) collecting host info 2) providing an ip address
CONSUME_INSTANCE_METHOD_NAME| Constructor and Description |
|---|
InetAddressClassReplacement() |
| Modifier and Type | Method and Description |
|---|---|
static InetAddress[] |
getAllByName(String host) |
static InetAddress |
getByName(String host) |
Class<?> |
getTargetClass() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetTargetClass, getTargetClassName, isAvailablepublic Class<?> getTargetClass()
getTargetClass in interface MethodReplacementClasspublic static InetAddress getByName(String host) throws UnknownHostException
UnknownHostExceptionpublic static InetAddress[] getAllByName(String host) throws UnknownHostException
UnknownHostExceptionCopyright © 2016–2024. All rights reserved.