Wait 100ms before closing socket to give server time to process.

This commit is contained in:
md_5 2013-03-11 09:30:49 +11:00
parent fa5804ec86
commit 0b7b87d9c3

View File

@ -1,7 +1,10 @@
package net.md_5.bungee;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import java.net.InetSocketAddress;
import java.util.concurrent.TimeUnit;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
@ -37,7 +40,14 @@ public class ServerConnection implements Server
if ( ch.isActive() )
{
ch.write( new PacketFFKick( reason ) );
ch.close();
ch.eventLoop().schedule( new Runnable()
{
@Override
public void run()
{
ch.close();
}
}, 100, TimeUnit.MILLISECONDS );
}
}