merla
merla

Reputation: 669

TCP socket server to handle multiple clients connections concurrently using spring integration

I have been working on creating TCP socket server using spring integration, with the reference from this post I am able to setup socket connection.

My requirement has 4 clients which establish socket connection with the server. How can I handle concurrent requests from all the 4 clients. what changes has to be done at TcpReceivingChannelAdapter.

Could someone help me out.

Upvotes: 2

Views: 1014

Answers (1)

Artem Bilan
Artem Bilan

Reputation: 121552

The concern isn't clear. The TcpNetServerConnectionFactory (any AbstractConnectionFactory) uses an Executor to distribute work from the established connections. And by default it is like:

if (this.taskExecutor == null) {
    this.privateExecutor = true;
    this.taskExecutor = Executors.newCachedThreadPool();
}

So, this says to us that indeed all the 4 clients are going to be handled on the server concurrently.

Upvotes: 2

Related Questions