我正在尝试通过TCP采样器从Jmeter向服务器发送消息 我已经在发送到消息框中配置了IP,端口号和消息,然后我开始点击服务器,此时我在Jmeter中收到以下警告。
并告诉我Jmeter中的TCP Client Class Name
,End Of Line Byte
字段值。
015/04/17 18:00:30 WARN - **![jmeter.protocol.tcp.sampler.TCPSampler: Could not create socket for tcp://port&IP java.net.ConnectException: Connection timed out: connect][1]**
at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.jmeter.protocol.tcp.sampler.TCPSampler.getSocket(TCPSampler.java:183)
at org.apache.jmeter.protocol.tcp.sampler.TCPSampler.sample(TCPSampler.java:399)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:434)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:261)
at java.lang.Thread.run(Thread.java:745)
答案 0 :(得分:1)
套接字连接错误已解决当您的服务器尚未准备好接收您的请求时将引发此异常。 所以在发送消息之前,请确认您的服务器已准备好接收请求。
答案 1 :(得分:0)
没有任何代码,很难确定你做错了什么,但看起来你传递了字符串
"tcp://port&IP"
而不是
"tcp://" + IP + ":" + port