Skip to content

Commit

Permalink
wilupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
胡宏韬 committed Nov 15, 2018
1 parent 1f89085 commit 3341366
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public ScanRunnable initRunable(@Autowired InitNetty serverBean){
@Bean(initMethod = "open", destroyMethod = "close")
@ConditionalOnMissingBean
public InitServer initServer(InitNetty serverBean){
if(!ObjectUtils.allNotNull(serverBean.getMqttport(),serverBean.getServerName())){
if(!ObjectUtils.allNotNull(serverBean.getWebport(),serverBean.getServerName())){
throw new NullPointerException("not set port");
}
if(serverBean.getBacklog()<1){
Expand All @@ -77,9 +77,6 @@ public InitServer initServer(InitNetty serverBean){
if(serverBean.getWorkerThread()<1){
serverBean.setWorkerThread(CPU*2);
}
if(serverBean.getProtocol()==null){
serverBean.setProtocol(ProtocolEnum.MQTT);
}
return new InitServer(serverBean);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,8 @@
@ConfigurationProperties(prefix = "netty")
public class InitNetty {

private ProtocolEnum protocol;

private int webport;

private int tcpport;

private int mqttport;

private int bossThread;

private int workerThread;
Expand All @@ -32,30 +26,16 @@ public class InitNetty {

private int backlog;

private boolean nodelay;

private boolean reuseaddr;

private String serverName ;

private int sndbuf ;

private int revbuf ;

private int heart ;

private boolean ssl ;

private String jksFile;
private int sndbuf;

private String jksStorePassword;
private int revbuf;

private String jksCertificatePassword;
private int heart;

private Class<MqttHander> mqttHander ;
private int period;

private int initalDelay ;
private String serverName;

private int period ;
private int initalDelay;

}
5 changes: 4 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ netty:
backlog: 1024 # Socket parameter, server accepts the queue length of the connection, and if the queue is full, the client connection will be rejected
sndbuf: 10485760 # TCP data send buffer size.
revbuf: 10485760 # TCP data receive buffer size.
heart: 180 # Read timeout
heart: 180 # Read timeout
period: 10 # Cycle of re-hair
serverName: iot-netty-chat
initalDelay: 10 # Reset delay

0 comments on commit 3341366

Please sign in to comment.