更新依赖;去除无用代码
This commit is contained in:
@@ -1,17 +1,7 @@
|
||||
package lion;
|
||||
|
||||
import lion.ErrorCode.ErrorCode;
|
||||
import lombok.extern.log4j.Log4j;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.nio.channels.SocketChannel;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
|
||||
|
||||
@Log4j
|
||||
public class Main {
|
||||
|
||||
@@ -21,8 +11,4 @@ public class Main {
|
||||
|
||||
new storageNode();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ public class MessageCodec extends ByteToMessageCodec<AbstractMessage> {
|
||||
protected void decode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, List<Object> list) throws Exception {
|
||||
byte messageType = byteBuf.readByte();
|
||||
int length = byteBuf.readInt();
|
||||
System.out.println(length);
|
||||
byte[] bytes = new byte[length];
|
||||
byteBuf.readBytes(bytes);
|
||||
final String metadata = new String(bytes, StandardCharsets.UTF_8);
|
||||
|
||||
@@ -18,8 +18,7 @@ public class MultiThreadedHTTPServer {
|
||||
String real_ip;
|
||||
try{
|
||||
real_ip = InetAddress.getByName("lionwebsite.xyz").getHostAddress();
|
||||
}
|
||||
catch (UnknownHostException ignored){
|
||||
} catch (UnknownHostException ignored){
|
||||
real_ip = "207.60.50.74";
|
||||
}
|
||||
try(ServerSocket serverSocket = new ServerSocket(PORT)) {
|
||||
|
||||
@@ -59,10 +59,8 @@ public class storageNode {
|
||||
channel.pipeline().addLast(new LengthFieldBasedFrameDecoder(100000000, 1, 4));
|
||||
channel.pipeline().addLast(new MessageCodec());
|
||||
channel.pipeline().addLast(new MyChannelInboundHandlerAdapter(tempQueue));
|
||||
|
||||
}
|
||||
}).option(ChannelOption.SO_BACKLOG, 128)
|
||||
.childOption(ChannelOption.SO_KEEPALIVE, true)
|
||||
})
|
||||
.bind(26321);
|
||||
log.info("listen port:8080");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user