netty如何使用
发布网友
发布时间:2022-04-25 16:24
我来回答
共1个回答
热心网友
时间:2023-10-17 07:27
和spring , 先写一个类,然后与一般的bean同样配置
<!-- netty config example -->
<bean id="tcpServer" class="com.yixun.collector.server.NettyTCPServer" init-method="createServerBootstrap"
destroy-method="stopServer">
<property name="handshakePipelineFactory" ref="handshakePipelineFactory"></property>
</bean>
<bean id="handshakePipelineFactory" class="com.yixun.collector.server.HandshakePipelineFactory">
<property name="handshakeHandler" ref="handshakeHandler"></property>
<!-- <lookup-method name="createHandshakeHandler" bean="handshakeHandler" />
<property name="stringDecoder" ref="stringDecoder"></property>
<property name="stringEncoder" ref="stringEncoder"></property>
<property name="nulEncoder" ref="nulEncoder"></property>
<property name="frameSize" value="256"></property> -->
</bean>