简体   繁体   English

需要为服务器和客户端的TCP套接字连接编写加特林

[英]Need to write Gatling for TCP socket connection as server and as client

My application uses Java and Spring Integration for Tcp connection. 我的应用程序将Java和Spring Integration用于Tcp连接。 There are two types of features, In first I need to connect application as client and in another need to connect as server. 有两种类型的功能,首先,我需要将应用程序作为客户端进行连接,而另一种需要将其作为服务器进行连接。 Both are having two way communication using gateway using spring Integration. 两者都使用Spring Integration使用网关进行双向通信。

I need to write gatling script for same, but I am new to gatling. 我需要为它编写加特林脚本,但是我是新来的加特林。

It would be great if there is sample program which is similar to my requirement, that I can refer as reference. 如果有一个与我的要求相似的示例程序,那将是很好的,我可以将其作为参考。 Also I was not able to find any option for TCP in recorder. 另外,我在记录器中找不到TCP的任何选项。

Any help/pointer is really appreciated. 任何帮助/指针真的很感激。

Looks like existing Spring Integration TCP Sample meets your requirements. 看起来现有的Spring Integration TCP Sample满足您的要求。

You can find there an XML config for the: 您可以在其中找到以下内容的XML配置:

<int-ip:tcp-connection-factory id="crLfServer"
    type="server"
    port="${availableServerSocket}"/>

with an appropriate <int-ip:tcp-inbound-gateway> and: 使用适当的<int-ip:tcp-inbound-gateway>并:

<int-ip:tcp-connection-factory id="client"
    type="client"
    host="localhost"
    port="${availableServerSocket}"
    single-use="true"
    so-timeout="10000"/>

for the client side to communicate via <int-ip:tcp-outbound-gateway> . 客户端通过<int-ip:tcp-outbound-gateway>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 TCP套接字连接Java Client &lt;-&gt; C ++服务器中的意外行为 - Unexpected behaviour in TCP socket connection Java Client<-> c++ server 套接字TCP连接写入失败 - Socket TCP connection write failure TCP 客户端套接字挂在服务器套接字上 - TCP Client socket hanging the Server Socket Netty 客户端连接到 Tcp 服务器 - Netty Client Connection to Tcp Server 持久的TCP连接客户端/服务器 - Persistent TCP connection client / server 如何确定客户端连接是否在 java 服务器中的 TCP 套接字连接中终止? - How to find out if a client connection is terminated within a TCP socket connection in a java server? 客户端关闭或客户端重新启动时,Java Server套接字TCP连接处于CLOSE_WAIT状态 - Java Server socket TCP connection stuck in CLOSE_WAIT state while client shutdown or client restart 为什么我的TCP服务器套接字在一个客户端失去连接后关闭? - Why does my TCP server socket close after one client loses connection? java.net.ConnectException:连接被拒绝:client / server tcp socket中的connect ,, error - java.net.ConnectException: Connection refused: connect ,,error in client /server tcp socket 使用 TCP 连接(套接字编程)在 Java 中将 2D 矩阵从客户端发送到服务器 - Send a 2D Matrix from Client to Server in Java using TCP connection (Socket Programming)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM