2017-05-09 75 views
0

我使用這個非常簡單的配置:Spring集成UDP服務器不聽

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration" 
    xmlns:int-ip="http://www.springframework.org/schema/integration/ip" 
    xmlns:context="http://www.springframework.org/schema/context" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd 
     http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd 
     http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd 
     http://www.springframework.org/schema/integration/ip http://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd"> 

    <int:channel id="sendUdp"/> 

    <int-ip:udp-outbound-channel-adapter id="udpOut" host="localhost" port="11111" 
            multicast="false" check-length="true" 
            channel="sendUdp" acknowledge="true" 
            ack-host="localhost" ack-port="12312" 
            ack-timeout="5000"/> 

    <int-ip:udp-inbound-channel-adapter id="udpIn" port="11111" receive-buffer-size="500" 
            multicast="false" check-length="true" 
            channel="receiveUdp"/> 

    <int:service-activator id="updHandler" input-channel="receiveUdp" ref="listener"/> 

</beans> 

但是,當我嘗試遠程登錄本地主機11111它說,它無法連接到它。有人可以幫忙嗎?

回答

1

Telnet使用TCP而不是UDP。嘗試netcat。