Results 1 to 7 of 7

Thread: IceStorm ConnectionRefusedException

  1. #1
    Raul is offline Registered User
    Name: Raul CF
    Organization: uc3m
    Project: streaming video
    Join Date
    Jun 2009
    Posts
    4

    IceStorm ConnectionRefusedException

    Hello.
    I am trying the example about IceStorm from de pdf. I am using Ice 3.3.1, in an ubuntu 8.04 distro. I have just compiled and linked the publisher and the subscriber, and I have added the lines:

    Code:
    Ice::CommunicatorPtr communicator;
    communicator = Ice::initialize(argc, argv);
    because when I was compiling, communicator wasn't declared.
    The problem is that when I am going to execute the subscriber, it throws the following exception:

    terminate called after throwing an instance of 'Ice::ConnectionRefusedException'
    what(): Network.cpp:1220: Ice::ConnectionRefusedException:
    I have used the --Ice.Trace.Network=2, in order to see what was happening, and the result was:

    local address = 127.0.0.1:59622
    remote address = <not connected>

    So I suspect that subscriber is trying to connect to another machine, but, why is this happening? I supposed that subscriber acts like a server, and publisher like a client.
    any help?
    Thanks.

  2. #2
    dwayne's Avatar
    dwayne is offline ZeroC Staff
    Name: Dwayne Boone
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Jan 2005
    Location
    St. John's, Newfoundland
    Posts
    397
    While for normal event flow the publisher acts as a client and the subscriber as a server, at first the subscriber needs to contact the IceStorm service in order to register to receive events for the topic(s) it is interested in. In this case the subscriber is the client and IceStorm is the server. Most likely this is the connection attempt that is failing for you. You should make sure that the IceStorm TopicManager proxy you are using in the subscriber has the correct host/port settings.

  3. #3
    Raul is offline Registered User
    Name: Raul CF
    Organization: uc3m
    Project: streaming video
    Join Date
    Jun 2009
    Posts
    4
    Thank you for the fast response!
    My code for the subscriber is this (based on the example):

    Code:
    Ice::CommunicatorPtr communicator;
    communicator = Ice::initialize(argc, argv);
    Ice::ObjectPrx obj = communicator->stringToProxy("IceStorm/TopicManager:tcp -p 9999");
    IceStorm::TopicManagerPrx topicManager = IceStorm::TopicManagerPrx::checkedCast(obj);
    I have ensured that my firewall isn't blocking that port.
    What am I doing wrong?
    Thanks.

  4. #4
    dwayne's Avatar
    dwayne is offline ZeroC Staff
    Name: Dwayne Boone
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Jan 2005
    Location
    St. John's, Newfoundland
    Posts
    397
    What does your IceStorm configuration look like? Is it listening on port 9999? Is it running on the same host as your publisher? You are not specifying a host in your IceStorm proxy, meaning the subscriber will only try to connect using the loopback interface. Perhaps you need to specify a host using the "-h" option.

    Running both IceStorm and your subscriber with --Ice.Network=2 should help you figure out what is happening. You could also post those traces here if you need further help.

  5. #5
    Raul is offline Registered User
    Name: Raul CF
    Organization: uc3m
    Project: streaming video
    Join Date
    Jun 2009
    Posts
    4
    Yes, both the publisher and the subscriber are running in the same host, that's why I didn't specified the host.
    But, I think that I am disregarding something important, what do you mean when you say "Running both IceStorm and your subscriber"?
    I have just two exec's, a publisher and a subscriber, and I'm trying to run the subscriber and then the publisher, but I haven't got any IceStorm.
    The traces:

    The subscriber:
    $ ./sub --Ice.Trace.Network=2
    [ 06/26/09 18:38:46.085 Network: trying to establish tcp connection to 127.0.0.1:9999 ]
    [ 06/26/09 18:38:46.085 Network: failed to establish tcp connection
    local address = 127.0.0.1:46843
    remote address = <not connected>
    Network.cpp:1220: Ice::ConnectionRefusedException:
    connection refused: Connection refused ]
    [ 06/26/09 18:38:46.086 Network: closing tcp connection
    local address = 127.0.0.1:46843
    remote address = <not connected> ]
    [ 06/26/09 18:38:46.086 Network: trying to establish tcp connection to 127.0.0.1:9999 ]
    [ 06/26/09 18:38:46.086 Network: failed to establish tcp connection
    local address = 127.0.0.1:46844
    remote address = <not connected>
    Network.cpp:1220: Ice::ConnectionRefusedException:
    connection refused: Connection refused ]
    [ 06/26/09 18:38:46.086 Network: closing tcp connection
    local address = 127.0.0.1:46844
    remote address = <not connected> ]
    terminate called after throwing an instance of 'Ice::ConnectionRefusedException'
    what(): Network.cpp:1220: Ice::ConnectionRefusedException:
    connection refused: Connection refused
    Cancelado

    The publisher:
    $ ./pub --Ice.Trace.Network=2
    +[ 06/26/09 18:38:54.997 Network: trying to establish tcp connection to 127.0.0.1:9999 ]
    [ 06/26/09 18:38:54.997 Network: failed to establish tcp connection
    local address = 127.0.0.1:46845
    remote address = <not connected>
    Network.cpp:1220: Ice::ConnectionRefusedException:
    connection refused: Connection refused ]
    [ 06/26/09 18:38:54.998 Network: closing tcp connection
    local address = 127.0.0.1:46845
    remote address = <not connected> ]
    [ 06/26/09 18:38:54.998 Network: trying to establish tcp connection to 127.0.0.1:9999 ]
    [ 06/26/09 18:38:54.998 Network: failed to establish tcp connection
    local address = 127.0.0.1:46846
    remote address = <not connected>
    Network.cpp:1220: Ice::ConnectionRefusedException:
    connection refused: Connection refused ]
    [ 06/26/09 18:38:54.998 Network: closing tcp connection
    local address = 127.0.0.1:46846
    remote address = <not connected> ]
    terminate called after throwing an instance of 'Ice::ConnectionRefusedException'
    what(): Network.cpp:1220: Ice::ConnectionRefusedException:
    connection refused: Connection refused
    Cancelado

    Thank you.

  6. #6
    dwayne's Avatar
    dwayne is offline ZeroC Staff
    Name: Dwayne Boone
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Jan 2005
    Location
    St. John's, Newfoundland
    Posts
    397
    Quote Originally Posted by Raul View Post
    But, I think that I am disregarding something important, what do you mean when you say "Running both IceStorm and your subscriber"?
    I have just two exec's, a publisher and a subscriber, and I'm trying to run the subscriber and then the publisher, but I haven't got any IceStorm.
    Well, that is your problem then. You need to run the IceStorm service as well as the publisher and subscriber in order for this to work. You should take a look at one of the demos that come with Ice such as demo/IceStorm/clock to see a complete example. With IceStorm the publishers and subscribers are decoupled and all event flow goes through the IceStorm service. Publishers send events to IceStorm on a specific topic and then IceStorm distributes these events to all subscribers that are registered on that topic.

  7. #7
    Raul is offline Registered User
    Name: Raul CF
    Organization: uc3m
    Project: streaming video
    Join Date
    Jun 2009
    Posts
    4
    Perfect!
    Thank you very much for all the help.
    I have just tried and understood the example, now I'm going to modify my app.
    Thanks.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [IceGrid+IceStorm] ConnectionRefusedException
    By prettyMan in forum Help Center
    Replies: 2
    Last Post: 02-11-2010, 04:44 AM
  2. Replies: 4
    Last Post: 07-01-2009, 02:36 PM
  3. IceGrid: Ice.ConnectionRefusedException
    By mefoster in forum Help Center
    Replies: 13
    Last Post: 09-25-2006, 05:31 AM
  4. About Ice::ConnectionRefusedException
    By level in forum Help Center
    Replies: 6
    Last Post: 01-09-2006, 08:25 PM
  5. Replies: 1
    Last Post: 11-05-2004, 02:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •