Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-1276

JGroups ignores my custom SocketFactory

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Done
    • 2.10
    • 2.12
    • None
    • Hide

      MySocketFactory defaultSocketFactory = new MySocketFactory();
      channel.setSocketFactory(defaultSocketFactory);

      and also add the following call
      channel.getProtocolStack().getTransport().setSocketFactory(defaultSocketFactory);

      Show
      MySocketFactory defaultSocketFactory = new MySocketFactory(); channel.setSocketFactory(defaultSocketFactory); and also add the following call channel.getProtocolStack().getTransport().setSocketFactory(defaultSocketFactory);

    Description

      I was trying to replace the default socket factory with my own socket factory so I can decide if MulticaseSocket is created with InetSocketAddress or to use just the port(to experiment this "Invalid argument") and it doesn't use my socket factory.

      Looking in the code, the way(the call order) how the socket factory is forwarded to the protocols is wrong(I think) because the protocols are started with the default stack instead of my stack.

      prot_stack.getTopProtocol().setSocketFactory(socket_factory) should be called before the stack is started and not after.

      private void startStack(String cluster_name) throws ChannelException {
      .....
      try

      { prot_stack.startStack(cluster_name, local_addr); // calls start() in all protocols, from top to bottom }

      catch(Throwable e)

      { throw new ChannelException("failed to start protocol stack", e); }

      if(socket_factory != null)

      { prot_stack.getTopProtocol().setSocketFactory(socket_factory); }

      ....
      }

      Attachments

        Activity

          People

            rhn-engineering-bban Bela Ban
            adrian.tarau Adrian Tarau (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: