fixed #100
This commit is contained in:
parent
d3554f0f70
commit
ee2261d56a
@ -29,7 +29,7 @@ public class WeixinServerInitializer extends ChannelInitializer<SocketChannel> {
|
||||
public WeixinServerInitializer(Map<String, AesToken> aesTokenMap,
|
||||
WeixinMessageDispatcher messageDispatcher) {
|
||||
this.messageDispatcher = messageDispatcher;
|
||||
messageDecoder = new WeixinMessageDecoder(aesTokenMap);
|
||||
this.messageDecoder = new WeixinMessageDecoder(aesTokenMap);
|
||||
}
|
||||
|
||||
public int addAesToken(final AesToken asetoken){
|
||||
|
||||
@ -95,7 +95,7 @@ public final class WeixinServerBootstrap {
|
||||
*
|
||||
*/
|
||||
public WeixinServerBootstrap(String token) {
|
||||
this(null, token, null);
|
||||
this("", token, null);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -163,7 +163,7 @@ public final class WeixinServerBootstrap {
|
||||
for (AesToken aesToken : aesTokens) {
|
||||
this.aesTokenMap.put(aesToken.getWeixinId(), aesToken);
|
||||
}
|
||||
this.aesTokenMap.put(null, aesTokens[0]);
|
||||
this.aesTokenMap.put("", aesTokens[0]);
|
||||
this.messageHandlerList = new ArrayList<WeixinMessageHandler>();
|
||||
this.messageInterceptorList = new ArrayList<WeixinMessageInterceptor>();
|
||||
this.messageDispatcher = new WeixinMessageDispatcher(messageMatcher);
|
||||
@ -205,7 +205,6 @@ public final class WeixinServerBootstrap {
|
||||
EventLoopGroup bossGroup = new NioEventLoopGroup(bossThreads);
|
||||
EventLoopGroup workerGroup = new NioEventLoopGroup(workerThreads);
|
||||
try {
|
||||
|
||||
wechatInitializer = new WeixinServerInitializer(aesTokenMap,
|
||||
messageDispatcher);
|
||||
ServerBootstrap b = new ServerBootstrap();
|
||||
|
||||
@ -167,6 +167,6 @@ public class MessageServerStartup {
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
new MessageServerStartup().test2();
|
||||
new MessageServerStartup().test1();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user