Contents
Class ConnectionOrigin
java.lang.Object
com.hypixel.hytale.protocol.io.ConnectionOrigin
Remote address comparison shared by every
ChannelConnection.isFromSameOrigin(ChannelConnection) implementation.-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisFromSameOrigin(SocketAddress address1, SocketAddress address2) Tests if two remote addresses are from the same origin.
-
Method Details
-
isFromSameOrigin
public static boolean isFromSameOrigin(@Nullable SocketAddress address1, @Nullable SocketAddress address2) Tests if two remote addresses are from the same origin. They are the same origin if the addresses are equal, or if both are anInetSocketAddresswith the sameInetAddress. Two loopback addresses are always the same origin.- Parameters:
address1- the first remote address, ornullif it is unknownaddress2- the second remote address, ornullif it is unknown- Returns:
trueif the two addresses are from the same origin
-