内存优化,减轻GC压力
This commit is contained in:
@@ -4,6 +4,7 @@ import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.EOFException;
|
||||
import java.io.IOException;
|
||||
import java.net.SocketAddress;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.Channels;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
@@ -133,4 +134,11 @@ public abstract class KLALBRoutingProtocolPacket extends NetworkPacket {
|
||||
public static void writeKLALBPacketToChannel(WritableByteChannel writableByteChannel,KLALBRoutingProtocolPacket klb) throws IOException {
|
||||
klb.writeToChannel(writableByteChannel);
|
||||
}
|
||||
private transient SocketAddress from;
|
||||
public void setFrom(SocketAddress from) {
|
||||
this.from=from;
|
||||
}
|
||||
public SocketAddress getFrom(){
|
||||
return from;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user