Class TcpServer
java.lang.Object
org.geysermc.mcprotocollib.network.AbstractServer
org.geysermc.mcprotocollib.network.tcp.TcpServer
- All Implemented Interfaces:
Server
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionTcpServer(String host, int port, Supplier<? extends MinecraftProtocol> protocol, TcpConnectionManager tcpManager) TcpServer(String host, int port, Supplier<? extends MinecraftProtocol> protocol, TcpConnectionManager tcpManager, TcpServer.TcpServerSessionBuilder sessionBuilder) -
Method Summary
Modifier and TypeMethodDescriptionvoidio.netty.channel.ChannelInitializer<io.netty.channel.Channel> voidcreateSession(InetSocketAddress address) io.netty.channel.ChannelintgetPort()Gets the port the session is listening on.io.netty.bootstrap.ServerBootstrapinitBootstrap(io.netty.channel.ChannelInitializer<io.netty.channel.Channel> initializer) booleanReturns true if the listener is listening.voidsetChannel(io.netty.channel.Channel channel) Methods inherited from class org.geysermc.mcprotocollib.network.AbstractServer
addListener, addSession, bind, bind, bind, callEvent, close, close, close, createPacketProtocol, getGlobalFlags, getGlobalFlagSupplied, getHost, getListeners, getPacketProtocol, getSessions, hasGlobalFlag, removeListener, removeSession, setGlobalFlagMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.geysermc.mcprotocollib.network.Server
getGlobalFlag, getGlobalFlag
-
Constructor Details
-
TcpServer
public TcpServer(String host, int port, Supplier<? extends MinecraftProtocol> protocol, TcpConnectionManager tcpManager) -
TcpServer
public TcpServer(String host, int port, Supplier<? extends MinecraftProtocol> protocol, TcpConnectionManager tcpManager, TcpServer.TcpServerSessionBuilder sessionBuilder)
-
-
Method Details
-
buildChannelInitializer
public io.netty.channel.ChannelInitializer<io.netty.channel.Channel> buildChannelInitializer() -
initBootstrap
public io.netty.bootstrap.ServerBootstrap initBootstrap(io.netty.channel.ChannelInitializer<io.netty.channel.Channel> initializer) -
createSession
-
getPort
public int getPort()Description copied from interface:ServerGets the port the session is listening on.- Specified by:
getPortin interfaceServer- Overrides:
getPortin classAbstractServer- Returns:
- The listening port.
-
isListening
public boolean isListening()Description copied from interface:ServerReturns true if the listener is listening.- Returns:
- True if the listener is listening.
-
bindImpl
- Specified by:
bindImplin classAbstractServer
-
closeImpl
- Specified by:
closeImplin classAbstractServer
-
getChannel
public io.netty.channel.Channel getChannel() -
getTcpManager
-
getSessionBuilder
-
setChannel
public void setChannel(io.netty.channel.Channel channel)
-