Class TcpClientSession
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<Packet>
org.geysermc.mcprotocollib.network.tcp.TcpSession
org.geysermc.mcprotocollib.network.tcp.TcpClientSession
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,Session
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Field Summary
Fields inherited from class org.geysermc.mcprotocollib.network.tcp.TcpSession
disconnected, HA_PROXY_ENCODER_ID, host, ID, port, PROXY_HANDLER_ID, READ_TIMEOUT_HANDLER_ID, WRITE_TIMEOUT_HANDLER_ID -
Constructor Summary
ConstructorsConstructorDescriptionTcpClientSession(String host, int port, String bindAddress, int bindPort, MinecraftProtocol protocol, ProxyInfo proxy, TcpConnectionManager tcpManager) TcpClientSession(String host, int port, String bindAddress, int bindPort, MinecraftProtocol protocol, TcpConnectionManager tcpManager) TcpClientSession(String host, int port, MinecraftProtocol protocol, ProxyInfo proxy, TcpConnectionManager tcpManager) TcpClientSession(String host, int port, MinecraftProtocol protocol, TcpConnectionManager tcpManager) -
Method Summary
Modifier and TypeMethodDescriptionio.netty.bootstrap.BootstrapbuildBootstrap(io.netty.channel.ChannelInitializer<io.netty.channel.Channel> initializer) io.netty.channel.ChannelInitializer<io.netty.channel.Channel>buildChannelInitializer(boolean transferring) voidconnect(boolean wait, boolean transferring) Connects this session to its host and port.voidconnect(boolean wait, boolean transferring, io.netty.bootstrap.Bootstrap bootstrap) voiddisconnect(String reason, Throwable cause) Disconnects the session.intGets the session'sPacketCodecHelper.getProxy()Methods inherited from class org.geysermc.mcprotocollib.network.tcp.TcpSession
addListener, callConnected, callDisconnected, callDisconnecting, callPacketError, callPacketReceived, callPacketSending, callPacketSent, channelActive, channelInactive, channelRead0, connect, connect, disconnect, enableEncryption, exceptionCaught, flush, getChannel, getCompressionThreshold, getConnectTimeout, getFlag, getFlag, getFlags, getHost, getListeners, getLocalAddress, getPacketProtocol, getPort, getProtocol, getReadTimeout, getRemoteAddress, getWriteTimeout, hasFlag, isConnected, isDisconnected, refreshReadTimeoutHandler, refreshReadTimeoutHandler, refreshWriteTimeoutHandler, refreshWriteTimeoutHandler, removeListener, send, send, sendAsync, sendBundle, sendBundle, sendBundleDirect, sendBundleDirect, sendDelayedDirect, sendDirect, sendScheduledAsync, setAutoRead, setChannel, setCompressionThreshold, setCompressionThreshold, setConnectTimeout, setDisconnected, setFlag, setFlags, setHost, setListeners, setPort, setReadTimeout, setWriteTimeoutMethods inherited from class io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelReadMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemovedMethods inherited from interface org.geysermc.mcprotocollib.network.Session
disconnect, disconnect, switchInboundState, switchOutboundState
-
Constructor Details
-
TcpClientSession
public TcpClientSession(String host, int port, MinecraftProtocol protocol, TcpConnectionManager tcpManager) -
TcpClientSession
public TcpClientSession(String host, int port, MinecraftProtocol protocol, ProxyInfo proxy, TcpConnectionManager tcpManager) -
TcpClientSession
public TcpClientSession(String host, int port, String bindAddress, int bindPort, MinecraftProtocol protocol, TcpConnectionManager tcpManager) -
TcpClientSession
public TcpClientSession(String host, int port, String bindAddress, int bindPort, MinecraftProtocol protocol, ProxyInfo proxy, TcpConnectionManager tcpManager)
-
-
Method Details
-
buildChannelInitializer
public io.netty.channel.ChannelInitializer<io.netty.channel.Channel> buildChannelInitializer(boolean transferring) -
buildBootstrap
public io.netty.bootstrap.Bootstrap buildBootstrap(io.netty.channel.ChannelInitializer<io.netty.channel.Channel> initializer) -
connect
public void connect(boolean wait, boolean transferring) Description copied from interface:SessionConnects this session to its host and port.- Specified by:
connectin interfaceSession- Overrides:
connectin classTcpSession- Parameters:
wait- Whether to wait for the connection to be established before returning.transferring- Whether the session is a client being transferred.
-
connect
public void connect(boolean wait, boolean transferring, io.netty.bootstrap.Bootstrap bootstrap) -
getCodecHelper
Description copied from interface:SessionGets the session'sPacketCodecHelper.- Returns:
- The session's packet codec helper.
-
disconnect
Description copied from interface:SessionDisconnects the session. This method just wraps the reason into aComponent. It is recommended to use Components instead as they provide more flexibility.- Parameters:
reason- Reason for disconnecting.cause- Throwable responsible for disconnecting.- See Also:
-
getBindAddress
-
getBindPort
public int getBindPort() -
getProxy
-
getTcpManager
-