Interface NetworkClient
- All Known Subinterfaces:
Player, StatusClient
Represents a client connected to the server.
-
Method Summary
Modifier and TypeMethodDescriptionReturns an instance ofInetSocketAddressassociated with the client's socket address.intReturns the protocol version of the client.Returns the socket address of the client.Returns the virtual host the client is connected to.
-
Method Details
-
getSocketAddress
SocketAddress getSocketAddress()Returns the socket address of the client.- Returns:
- The client's socket address
-
getAddress
InetSocketAddress getAddress()Returns an instance ofInetSocketAddressassociated with the client's socket address.- Returns:
- The client's
InetSocketAddress, or the loopback address if this is a Unix domain socket connection
-
getProtocolVersion
int getProtocolVersion()Returns the protocol version of the client.- Returns:
- The client's protocol version, or
-1if unknown - See Also:
-
getVirtualHost
@Nullable InetSocketAddress getVirtualHost()Returns the virtual host the client is connected to.The virtual host refers to the hostname/port the client used to connect to the server.
- Returns:
- The client's virtual host, or
nullif unknown
-