IceStorm Subscriber/Endpoint Ports

KevinHKevinH Member Kevin HitzlerOrganization: PersonalProject: Android Application
edited September 2016 in Help Center

Hi ZeroC-Community,

I've got a question referring to the IceStorm subscriber ports.

In my project, I am trying to implement an App (Publisher) that communicates to a server (Subscriber) via text and audio using IceStorm. My problem is that we only want to use one specific port for this connection (e.g. port 80).

Right now my configuration looks like the following:

IceStorm.InstanceName=IceStorm IceStorm.TopicManager.Endpoints=default -h 141.2.28.111 -p 80 IceStorm.Publish.Endpoints=default -h 141.2.28.111 -p 10002 ...

My server (subscriber) uses port 80 to create the Ice-Object and registers two Object-Adapters (1 for audio, 1 for text):

communicator = Ice.Util.initialize(args); Ice.ObjectPrx obj = communicator.stringToProxy("IceStorm/TopicManager:default -p 80 -h 141.2.28.111"); IceStorm.TopicManagerPrx topicManager = IceStorm.TopicManagerPrxHelper.checkedCast(obj); ObjectAdapter adapter = communicator.createObjectAdapterWithEndpoints("AsyncStreamingAdapter", "tcp -p 10010 -h 141.2.28.111"); ObjectAdapter adapter2 = communicator.createObjectAdapterWithEndpoints("TextListenerAdapter", "tcp -p 10011 -h 141.2.28.111"); AsyncStreamingInterface async = new AsyncStreamingInterfaceI(); Ice.ObjectPrx proxy = adapter.addWithUUID(async).ice_oneway(); adapter.activate(); TextListenerInterface textListener = new TextListenerInterfaceI(); Ice.ObjectPrx proxy2 = adapter2.addWithUUID(textListener); adapter2.activate();

When I call a method from the publisher - let's say in a mobile hotspot connection between server and client and no firewall in between - everything works fine. But in our local WiFi-network where we only want to open Port 80, I get a ConnectionRefused Exception in my publisher (Client):

Sending Message... Ice.ConnectionRefusedException error = 0 at IceInternal.AsyncResultI.__wait(AsyncResultI.java:270) at Ice.ObjectPrxHelperBase.__end(ObjectPrxHelperBase.java:2646) at armarx.TextListenerInterfacePrxHelper.end_reportText(TextListenerInterfacePrxHelper.java:146) at armarx.TextListenerInterfacePrxHelper.reportText(TextListenerInterfacePrxHelper.java:42) at armarx.TextListenerInterfacePrxHelper.reportText(TextListenerInterfacePrxHelper.java:32) at Client.main(Client.java:50) Caused by: java.net.ConnectException: Connection refused: no further information at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) at IceInternal.Network.doFinishConnect(Network.java:437) at IceInternal.StreamSocket.connect(StreamSocket.java:96) at IceInternal.TcpTransceiver.initialize(TcpTransceiver.java:24) at Ice.ConnectionI.initialize(ConnectionI.java:1921) at Ice.ConnectionI.message(ConnectionI.java:940) at IceInternal.ThreadPool.run(ThreadPool.java:395) at IceInternal.ThreadPool.access$300(ThreadPool.java:12) at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:832) at java.lang.Thread.run(Thread.java:745)
Although, the client has successfully connected to the server:

-- 09/30/16 16:05:58.525 icebox-IceStorm: Network: tcp connection established
   local address = 141.2.28.111:80
   remote address = 141.2.28.112:55524
-- 09/30/16 16:05:58.525 icebox-IceStorm: Network: sent 14 of 14 bytes via tcp
   local address = 141.2.28.111:80
   remote address = 141.2.28.112:55524
-- 09/30/16 16:05:58.529 icebox-IceStorm: Network: received 14 of 14 bytes via tcp
   local address = 141.2.28.111:80
   remote address = 141.2.28.112:55524
-- 09/30/16 16:05:58.529 icebox-IceStorm: Network: received 58 of 58 bytes via tcp
   local address = 141.2.28.111:80
   remote address = 141.2.28.112:55524
-- 09/30/16 16:05:58.529 icebox-IceStorm: Network: sent 97 of 97 bytes via tcp
   local address = 141.2.28.111:80
   remote address = 141.2.28.112:55524
-- 09/30/16 16:06:02.568 icebox-IceStorm: Network: received 14 of 14 bytes via tcp
   local address = 141.2.28.111:80
   remote address = 141.2.28.112:55524
-- 09/30/16 16:06:02.568 icebox-IceStorm: Network: closing tcp connection
   local address = 141.2.28.111:80
   remote address = 141.2.28.112:55524
-- 09/30/16 16:06:02.569 icebox-IceStorm: Network: received 14 of 14 bytes via tcp
   local address = 141.2.28.111:80
   remote address = 141.2.28.112:55523
-- 09/30/16 16:06:02.569 icebox-IceStorm: Network: closing tcp connection
   local address = 141.2.28.111:80
   remote address = 141.2.28.112:55523
-- 09/30/16 16:06:56.610 icebox-IceStorm: Network: received 14 of 14 bytes via tcp
   local address = 141.2.28.111:80
   remote address = 141.2.28.111:43100
-- 09/30/16 16:06:56.610 icebox-IceStorm: Network: closing tcp connection
   local address = 141.2.28.111:80
   remote address = 141.2.28.111:43100

Is there a mistake in my port/endpoint configuration? Or is there a way to use IceStorm with only one opened port?

Thank you very much in advance!

Best,
Kevin

Best Answer

  • mesmes ZeroC Staff CaliforniaMark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Accepted Answer

    Hi,

    Can you run the publisher client with --Ice.Trace.Network=3 --Ice.Trace.Protocol and post the log output leading up to the ConnectionRefusedException?

    Thanks,
    Mark

Answers

  • mesmes ZeroC Staff CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Accepted Answer

    Hi,

    Can you run the publisher client with --Ice.Trace.Network=3 --Ice.Trace.Protocol and post the log output leading up to the ConnectionRefusedException?

    Thanks,
    Mark

  • KevinHKevinH Member Kevin HitzlerOrganization: PersonalProject: Android Application

    Hi Mark,

    thanks for your fast reply. I will post the log output as soon as I am back to work (probably at the end of this week).

    Thanks,
    Kevin

Sign In or Register to comment.