‘liusuyi’
2024-02-01 b587ba125adcee0631bc816540779cca56f9099b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.ard.utils.netty.udp;
 
import com.ard.utils.netty.config.NettyUdpConfiguration;
import org.springframework.stereotype.Component;
 
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
 
/**
 * @Description: 初始化启动nettyUdp服务
 * @ClassName: InitUdpServer
 * @Author: 刘苏义
 * @Date: 2023年12月05日9:59:50
 **/
@Component
public class InitUdpServer {
    @Resource
    NettyUdpServer nettyUdpServer;
    @Resource
    NettyUdpConfiguration nettyUdpConfig;
 
    @PostConstruct
    void start()
    {
        if(nettyUdpConfig.getEnabled()) {
            nettyUdpServer.start(nettyUdpConfig.getPort());
        }
    }
}