DDDHuang commented on a change in pull request #637: URL: https://github.com/apache/jmeter/pull/637#discussion_r544077899
########## File path: src/protocol/tcp/src/main/java/org/apache/jmeter/protocol/tcp/proxy/TCPSamplerManager.java ########## @@ -0,0 +1,128 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.jmeter.protocol.tcp.proxy; + +import java.util.ArrayDeque; +import java.util.Queue; + +import org.apache.jmeter.exceptions.IllegalUserActionException; +import org.apache.jmeter.gui.GuiPackage; +import org.apache.jmeter.gui.tree.JMeterTreeNode; +import org.apache.jmeter.protocol.tcp.control.gui.TCPSamplerGui; +import org.apache.jmeter.protocol.tcp.proxy.gui.TCPProxyDef; +import org.apache.jmeter.protocol.tcp.sampler.BinaryTCPClientImpl; +import org.apache.jmeter.protocol.tcp.sampler.TCPSampler; +import org.apache.jmeter.samplers.SampleResult; +import org.apache.jmeter.testelement.TestElement; +import org.apache.jorphan.util.JOrphanUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TCPSamplerManager extends Thread { + private static final Logger log = LoggerFactory.getLogger(TCPSamplerManager.class); + + private final JMeterTreeNode targetNode; + private final TestElement tcpSamplerElement; + private boolean workStatus = false; + + private final Queue<TCPSampler> tcpSamplerInfoQueue = new ArrayDeque<>(); + + public TCPSamplerManager(TestElement tcpSamplerElement, JMeterTreeNode targetNode) { + this.tcpSamplerElement = tcpSamplerElement; + this.targetNode = targetNode; + } + + /** + * create a new TCPSampler and put into TCPSampler queue. + * manager will store all TCPSampler to target JmeterTreeNode. + * + * @param data tcp payload + * @return target server response payload + */ + public byte[] newTCPSampler(String data) { + log.debug("new sampler , payload " + data); Review comment: Thank you for your suggestion. I have changed the log style in new commit. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
