Archived

This forum has been archived. Please start a new discussion on GitHub.

How to deploy the IcePack sample?

There is no problem to make both server and client run in the same machine, but I don't understand how to deploy server and client in different machine.

I follow the instruction in README
1. In the server, run icepacknode --Ice.Config=config --warn
and I change the config file to this
Ice.Default.Locator=IcePack/Locator:default -h 192.168.0.100 -p 12000
why don't need to specify the IcePack/Query Endpoint ?
2. In ther server, run icepackadmin --Ice.Config=config -e "application add 'application.xml'"

3. In the client, run the client program,

here is the client trace
[ Network: trying to establish tcp connection to 219.136.129.242:12000 ]
[ Network: tcp connection established
local address = 59.41.73.138:2886
remote address = 219.136.129.242:12000 ]
[ Protocol: received validate connection
message type = 3 (validate connection)
compression status = 0 (not compressed; do not compress response, if any)
message size = 14 ]
[ Protocol: sending request
message type = 0 (request)
compression status = 0 (not compressed; do not compress response, if any)
message size = 72
request id = 1
identity = IcePack/Locator
facet =
operation = findObjectById
mode = 1 (nonmutating)
context = ]
[ Protocol: received reply
message type = 2 (reply)
compression status = 0 (not compressed; do not compress response, if any)
message size = 77
request id = 1
reply status = 0 (ok) ]
[ Protocol: sending request
message type = 0 (request)
compression status = 0 (not compressed; do not compress response, if any)
message size = 66
request id = 2
identity = IcePack/Query
facet =
operation = ice_isA
mode = 1 (nonmutating)
context = ]
[ Protocol: received reply
message type = 2 (reply)
compression status = 0 (not compressed; do not compress response, if any)
message size = 26
request id = 2
reply status = 0 (ok) ]
[ Protocol: sending request
message type = 0 (request)
compression status = 0 (not compressed; do not compress response, if any)
message size = 72
request id = 3
identity = IcePack/Query
facet =
operation = findObjectByType
mode = 1 (nonmutating)
context = ]
[ Protocol: received reply
message type = 2 (reply)
compression status = 0 (not compressed; do not compress response, if any)
message size = 56
request id = 3
reply status = 0 (ok) ]
[ Protocol: sending request
message type = 0 (request)
compression status = 0 (not compressed; do not compress response, if any)
message size = 78
request id = 4
identity = IcePack/Locator
facet =
operation = findAdapterById
mode = 1 (nonmutating)
context = ]
[ Protocol: received reply
message type = 2 (reply)
compression status = 0 (not compressed; do not compress response, if any)
message size = 117
request id = 4
reply status = 0 (ok) ]
[ Network: trying to establish tcp connection to 127.0.0.1:35602 ]
[ Network: trying to establish ssl connection to 127.0.0.1:35603 ]
[ Protocol: sending request
message type = 0 (request)
compression status = 0 (not compressed; do not compress response, if any)
message size = 78
request id = 5
identity = IcePack/Locator
facet =
operation = findAdapterById
mode = 1 (nonmutating)
context = ]
[ Protocol: received reply
message type = 2 (reply)
compression status = 0 (not compressed; do not compress response, if any)
message size = 117
request id = 5
reply status = 0 (ok) ]
[ Network: trying to establish tcp connection to 127.0.0.1:35602 ]
[ Network: trying to establish ssl connection to 127.0.0.1:35603 ]
.\Network.cpp:545: Ice::ConnectionRefusedException:
connection refused: WSAECONNREFUSED
[ Protocol: sending close connection
message type = 4 (close connection)
compression status = 1 (not compressed; compress response, if any)
message size = 14 ]
[ Network: shutting down tcp connection for writing
local address = 59.41.73.138:2886
remote address = 219.136.129.242:12000 ]
[ Network: closing tcp connection
local address = 59.41.73.138:2886
remote address = 219.136.129.242:12000 ]

Why the client try to connect 127.0.0.1?

BTW, how to the make Endpoint to bind all the network interface ?

Comments

  • It is ok now, but...

    the sample is ok after I modified the application.xml

    <adapter name="Hello" endpoints="tcp -h 192.168.0.123:udp -h 192.168.0.123:ssl -h 192.168.0.123" register="true">

    The problem is, the endpoints does not bind to all the network interface, if does not specify the -h option it only binds to the loopback interface.

    Is it possible to bind to all the network interface ?
  • matthew
    matthew NL, Canada
    zhangzq71 wrote:
    There is no problem to make both server and client run in the same machine, but I don't understand how to deploy server and client in different machine.

    I follow the instruction in README
    1. In the server, run icepacknode --Ice.Config=config --warn
    and I change the config file to this
    Ice.Default.Locator=IcePack/Locator:default -h 192.168.0.100 -p 12000
    why don't need to specify the IcePack/Query Endpoint ?
    2. In ther server, run icepackadmin --Ice.Config=config -e "application add 'application.xml'"

    3. In the client, run the client program,

    here is the client trace


    Why the client try to connect 127.0.0.1?

    BTW, how to the make Endpoint to bind all the network interface ?

    You don't need to specify the IcePack/Query endpoint because this is resolved using the IcePack locator.

    The problem is your server is using the wrong endpoint. You must set the host information in the endpoint attribute of the adapter descriptor.

    If you want your endpoint to listen on multiple network interfaces you must set that information in the endpoint property. See section 29.3 (page 673) of the Ice 2.1.0 manual for more information on this.

    Regards, Matthew
  • Matthew,

    Accroding to the manual, I have to specify the Endpoints for all network interface if I want to bind a specified port to ANY.

    suggestion -- how about add an option for binding ANY.
    problem -- for my current machine with multi network interfaces, if I don't specify the -h option, the IP the endpoints will bind seems un-predictable.


    Regards,
    ZhangZQ
  • marc
    marc Florida
    You can use -h 0.0.0.0 to bind to all interfaces. However, collocation optimization might not work in this case, because the Ice runtime cannot determine if an IP address is local if it has only 0.0.0.0 to compare with. (We have to add something to Ice that retrieves all local IP addresses for this purpose. Unfortunately, the mechanics to retrieve all local IP addresses is different on every platform, therefore we didn't implement this yet.)

    If you don't specify an IP address, the Ice runtime will first do a gethostname to get the host's name, and then do a gethostbyname with this name to determine the host's IP address. So what IP address that is chosen is not unpredictable -- you can easily reproduce the result by first doing a gethostname, and then a nslookup for that name.