public String getUsername(final Packet packet, final RemotingConnection connection)
{
RemotingConnectionImpl impl = (RemotingConnectionImpl)connection;
ChannelImpl channel = (ChannelImpl) impl.getChannel(packet.getChannelID(), -1);
ServerSessionPacketHandler sessionHandler = (ServerSessionPacketHandler) channel.getHandler();
return sessionHandler.getSession().getUsername();
}