Skip to content

Commit

Permalink
bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
TongxiJi committed Jul 5, 2018
1 parent 0823087 commit 245eee6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion shell/shadowsocks-netty-server.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
java -Dio.netty.maxDirectMemory=0 -Dio.netty.leakDetectionLevel=advanced -jar shadowsocks-netty-server-0.0.1.jar
java -Dio.netty.maxDirectMemory=0 -Dio.netty.leakDetectionLevel=advanced -jar shadowsocks-netty-server-1.0.0.jar
pause
2 changes: 1 addition & 1 deletion shell/shadowsocks-netty-server.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash
#java -Dio.netty.maxDirectMemory=0 -Dio.netty.leakDetectionLevel=advanced -jar shadowsocks-netty-server-0.9.0.jar &
#java -Dio.netty.maxDirectMemory=0 -Dio.netty.leakDetectionLevel=advanced -jar shadowsocks-netty-server-1.0.0.jar &
java -jar shadowsocks-netty-server-0.9.0.jar &
6 changes: 3 additions & 3 deletions src/main/java/cn/wowspeeder/SocksServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void start() {
tcpBootstrap = new ServerBootstrap();
tcpBootstrap.group(bossGroup, workerGroup).channel(NioServerSocketChannel.class)
.option(ChannelOption.SO_BACKLOG,5120)
.option(ChannelOption.SO_RCVBUF, 32 * 1024)// 读缓冲区为32k
// .option(ChannelOption.SO_RCVBUF, 32 * 1024)// 读缓冲区为32k
.childOption(ChannelOption.SO_KEEPALIVE, true)
.childOption(ChannelOption.TCP_NODELAY, true)
.childOption(ChannelOption.SO_LINGER, 1) //关闭时等待1s发送关闭
Expand Down Expand Up @@ -91,8 +91,8 @@ protected IdleStateEvent newIdleStateEvent(IdleState state, boolean first) {
udpBootstrap = new Bootstrap();
udpBootstrap.group(bossGroup).channel(NioDatagramChannel.class)
.option(ChannelOption.SO_BROADCAST, true)// 支持广播
.option(ChannelOption.SO_RCVBUF, 64 * 1024)// 设置UDP读缓冲区为64k
.option(ChannelOption.SO_SNDBUF, 64 * 1024)// 设置UDP写缓冲区为64k
// .option(ChannelOption.SO_RCVBUF, 64 * 1024)// 设置UDP读缓冲区为64k
// .option(ChannelOption.SO_SNDBUF, 64 * 1024)// 设置UDP写缓冲区为64k
.handler(new ChannelInitializer<NioDatagramChannel>() {

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/cn/wowspeeder/ss/SSTcpProxyHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ private void proxy(ChannelHandlerContext clientCtx, ByteBuf msg) {
InetSocketAddress clientRecipient = clientCtx.channel().attr(SSCommon.REMOTE_DES).get();

proxyClient.group(proxyBossGroup).channel(NioSocketChannel.class)
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 20 * 1000)
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 60 * 1000)
.option(ChannelOption.SO_KEEPALIVE, true)
.option(ChannelOption.SO_RCVBUF, 32 * 1024)// 读缓冲区为32k
// .option(ChannelOption.SO_RCVBUF, 32 * 1024)// 读缓冲区为32k
.option(ChannelOption.TCP_NODELAY, true)
.handler(
new ChannelInitializer<Channel>() {
Expand Down

0 comments on commit 245eee6

Please sign in to comment.