mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-01-19 16:57:20 +07:00
Removed individual handlers for inbound and outbound traffic -- replaced with ReliableChannelHandler
This commit is contained in:
parent
01888faac6
commit
3f51d1d503
@ -1,78 +0,0 @@
|
||||
package com.riiablo.server.netty;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelInboundHandler;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
|
||||
public class ReliableInboundHandler implements ChannelInboundHandler {
|
||||
private static final String TAG = "ReliableInboundHandler";
|
||||
|
||||
ReliableInboundHandler() {}
|
||||
|
||||
@Override
|
||||
public void channelRegistered(ChannelHandlerContext ctx) throws Exception {
|
||||
Gdx.app.debug(TAG, "channelRegistered");
|
||||
ctx.fireChannelRegistered();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void channelUnregistered(ChannelHandlerContext ctx) throws Exception {
|
||||
Gdx.app.debug(TAG, "channelUnregistered");
|
||||
ctx.fireChannelUnregistered();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
||||
Gdx.app.debug(TAG, "channelActive");
|
||||
ctx.fireChannelActive();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||
Gdx.app.debug(TAG, "channelInactive");
|
||||
ctx.fireChannelInactive();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
||||
Gdx.app.debug(TAG, "channelRead");
|
||||
ctx.fireChannelRead(msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
|
||||
Gdx.app.debug(TAG, "channelReadComplete");
|
||||
ctx.fireChannelReadComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
|
||||
Gdx.app.debug(TAG, "userEventTriggered");
|
||||
ctx.fireUserEventTriggered(evt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception {
|
||||
Gdx.app.debug(TAG, "channelWritabilityChanged");
|
||||
ctx.fireChannelWritabilityChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
|
||||
Gdx.app.debug(TAG, "handlerAdded");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlerRemoved(ChannelHandlerContext ctx) throws Exception {
|
||||
Gdx.app.debug(TAG, "handlerRemoved");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||
Gdx.app.debug(TAG, "exceptionCaught");
|
||||
ctx.fireExceptionCaught(cause);
|
||||
}
|
||||
}
|
@ -1,80 +0,0 @@
|
||||
package com.riiablo.server.netty;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelOutboundHandler;
|
||||
import io.netty.channel.ChannelPromise;
|
||||
import java.net.SocketAddress;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
|
||||
public class ReliableOutboundHandler implements ChannelOutboundHandler {
|
||||
private static final String TAG = "ReliableOutboundHandler";
|
||||
|
||||
ReliableOutboundHandler() {}
|
||||
|
||||
@Override
|
||||
public void bind(ChannelHandlerContext ctx, SocketAddress localAddress, ChannelPromise promise) throws Exception {
|
||||
Gdx.app.debug(TAG, "bind");
|
||||
ctx.bind(localAddress, promise);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void connect(ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) throws Exception {
|
||||
Gdx.app.debug(TAG, "connect");
|
||||
ctx.connect(remoteAddress, localAddress, promise);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disconnect(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception {
|
||||
Gdx.app.debug(TAG, "disconnect");
|
||||
ctx.disconnect(promise);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception {
|
||||
Gdx.app.debug(TAG, "close");
|
||||
ctx.close(promise);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deregister(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception {
|
||||
Gdx.app.debug(TAG, "deregister");
|
||||
ctx.deregister(promise);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(ChannelHandlerContext ctx) throws Exception {
|
||||
Gdx.app.debug(TAG, "read");
|
||||
ctx.read();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
|
||||
Gdx.app.debug(TAG, "write");
|
||||
ctx.write(msg, promise);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flush(ChannelHandlerContext ctx) throws Exception {
|
||||
Gdx.app.debug(TAG, "flush");
|
||||
ctx.flush();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
|
||||
Gdx.app.debug(TAG, "handlerAdded");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlerRemoved(ChannelHandlerContext ctx) throws Exception {
|
||||
Gdx.app.debug(TAG, "handlerRemoved");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||
Gdx.app.debug(TAG, "channelRegistered");
|
||||
ctx.fireExceptionCaught(cause);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user