Interface INetworkClient
-
- All Superinterfaces:
java.lang.AutoCloseable,IPacketSender
- All Known Implementing Classes:
NettyNetworkClient
public interface INetworkClient extends java.lang.AutoCloseableThe network client represents a client based connector to one or more remote servers.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidcloseChannels()Close all open connections from this network componentbooleanconnect(@NotNull HostAndPort hostAndPort)Open a new connection to the specific host and portjava.util.Collection<INetworkChannel>getChannels()Returns all running enabled connections from the network componentlonggetConnectedTime()Gets the time when this client was connected to the server in millisecondsdefault INetworkChannelgetFirstChannel()java.util.concurrent.ExecutorgetPacketDispatcher()IPacketListenerRegistrygetPacketRegistry()Returns the parent packet registry from all channels, that are this network component providebooleanisSslEnabled()Returns true if the network component allows to create a ssl connection-
Methods inherited from interface de.dytanic.cloudnet.driver.network.protocol.IPacketSender
sendPacket, sendPacket, sendPacketSync, sendPacketSync
-
-
-
-
Method Detail
-
connect
boolean connect(@NotNull @NotNull HostAndPort hostAndPort)Open a new connection to the specific host and port- Parameters:
hostAndPort- the address, that should the client connect to- Returns:
- true if the connection was success or false if the connection was unsuccessful or refused
-
getConnectedTime
long getConnectedTime()
Gets the time when this client was connected to the server in milliseconds
-
isSslEnabled
boolean isSslEnabled()
Returns true if the network component allows to create a ssl connection
-
getChannels
java.util.Collection<INetworkChannel> getChannels()
Returns all running enabled connections from the network component
-
getFirstChannel
default INetworkChannel getFirstChannel()
-
getPacketDispatcher
java.util.concurrent.Executor getPacketDispatcher()
-
closeChannels
void closeChannels()
Close all open connections from this network component
-
getPacketRegistry
IPacketListenerRegistry getPacketRegistry()
Returns the parent packet registry from all channels, that are this network component provide
-
-