Announcement Announcement Module
Collapse
No announcement yet.
tcp multiple clients Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • tcp multiple clients

    Hi,
    Probably it's obvious however I would like what are the options to create many tcp clients.
    My requirement says: a client should connect to multiple servers.

    Thanks,
    Oleg



  • #2
    Hi Oleg!

    Or there is not enough info from your question, or the answer is very simple: FailoverClientConnectionFactory.

    From other side, please be more specific: what is client in your case.
    And how does correlate with sentence " create many tcp clients"

    Comment


    • #3
      Hi Artem.
      Say, I have N servers. From some point, I would like to be connected to all of them.
      For instance,
      tcp_client_1 --> tcp_server_1 ... tcp_client_N --> tcp_server_N.

      From what I know, to create tcp client I have to use tcp factory that cannot be reused, right? Or I am wrong with such assumption.

      Comment


      • #4
        Not sure what you mean about "reused", but yes, each ClinetConnectionFactory (TcpNetClientConnectionFactory, TcpNioClientConnectionFactory) should be configured for the server (host/port) only once from its constructor.
        If you need to to get deal with all your servers simultaneously, you should implement your own CompositeClientConnectionFactory and do some tricks for delegations. The CachingClientConnectionFactory and FailoverClientConnectionFactory have some points to study, although they get deal only with one server at a time

        Comment


        • #5
          Thanks, very appreciate!

          Oleg

          Comment

          Working...
          X