Interface INetworkServer
-
- All Superinterfaces:
java.lang.AutoCloseable,IPacketSender
- All Known Implementing Classes:
NettyNetworkServer
public interface INetworkServer extends java.lang.AutoCloseableThe network server represents a server that can register and receive INetworkClient connections and packets It is made for a simple read and write network with a client and a server. You can bind this server on more than one addresses- See Also:
INetworkClient
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleanaddListener(int port)Binds the server to a specific port with the host alias address "0.0.0.0"booleanaddListener(@NotNull HostAndPort hostAndPort)Binds the server to a specific address that is as parameter definedvoidcloseChannels()Close all open connections from this network componentjava.util.Collection<INetworkChannel>getChannels()Returns all running enabled connections from the network componentdefault 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
-
addListener
boolean addListener(int port)
Binds the server to a specific port with the host alias address "0.0.0.0"- Parameters:
port- the port, that the server should bind- Returns:
- true when the binding was successful or false if an error was threw or the port is already bind
-
addListener
boolean addListener(@NotNull @NotNull HostAndPort hostAndPort)Binds the server to a specific address that is as parameter defined- Parameters:
hostAndPort- the address that should the server bind- Returns:
- true when the binding was successful or false if an error was threw or the port is already bind
-
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
-
-