Archived

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

Callback sample problem

I tried the Callback sample today on two gateway machines that both have 2 ethernet interface card, one for internet connection another for internal network, and the internal IP of that 2 gateway are both 192.168.0.1.

Now one gateway runs the server another runs the client, here is the server trace,
[ ./server: Network: attempting to bind to tcp socket 218.19.57.26:10000 ]
[ ./server: Network: accepting tcp connections at 218.19.57.26:10000 ]
[ ./server: Network: attempting to bind to udp socket 218.19.57.26:10000 ]
[ ./server: Network: starting to receive udp packets
local address = 218.19.57.26:10000
remote address = <not connected> ]
[ ./server: Network: attempting to bind to ssl socket 218.19.57.26:10001 ]
[ ./server: Network: accepting ssl connections at 218.19.57.26:10001 ]





[ ./server: Network: accepted tcp connection
local address = 218.19.57.26:10000
remote address = 59.42.130.223:2323 ]
[ ./server: Protocol: sending validate connection
message type = 3 (validate connection)
compression status = 0 (not compressed; do not compress response, if any)
message size = 14 ]
[ ./server: Protocol: received request
message type = 0 (request)
compression status = 0 (not compressed; do not compress response, if any)
message size = 62
request id = 1
identity = callback
facet =
operation = ice_isA
mode = 1 (nonmutating)
context = ]
[ ./server: Protocol: sending reply
message type = 2 (reply)
compression status = 0 (not compressed; do not compress response, if any)
message size = 26
request id = 1
reply status = 0 (ok) ]
[ ./server: Protocol: received request
message type = 0 (request)
compression status = 0 (not compressed; do not compress response, if any)
message size = 163
request id = 2
identity = callback
facet =
operation = initiateCallback
mode = 0 (normal)
context = ]
initiatingcallback
[ ./server: Network: trying to establish tcp connection to 192.168.0.1:2326 ]
[ ./server: Network: trying to establish ssl connection to 192.168.0.1:2330 ]
[ ./server: Network: trying to establish tcp connection to 192.168.0.1:2326 ]
[ ./server: Network: trying to establish ssl connection to 192.168.0.1:2330 ]

Network.cpp:545: Ice::ConnectionRefusedException:
connection refused: Connection refused
[ ./server: Protocol: sending reply
message type = 2 (reply)
compression status = 0 (not compressed; do not compress response, if any)
message size = 25
request id = 2
reply status = 0 (ok) ]
[ ./server: Protocol: sending close connection
message type = 4 (close connection)
compression status = 1 (not compressed; compress response, if any)
message size = 14 ]
[ ./server: Network: shutting down tcp connection for writing
local address = 218.19.57.26:10000
remote address = 59.42.130.223:2323 ]
[ ./server: Network: closing tcp connection
local address = 218.19.57.26:10000
remote address = 59.42.130.223:2323 ]

Please notice the red text, I think the 192.168.0.1 is the IP of that gateway running client, but I did not specified this IP in the config file, I used the internet IP for the -h option in both side.

Is this a bug or I don't understand how to deploy this sample ?

And in client side, the port 2326 is in listening mode,
TCP macrohard:2326 macrohard:0 LISTENING 1492
TCP macrohard:2330 macrohard:0 LISTENING 1492
1492 is the client PID.

Comments

  • matthew
    matthew NL, Canada
    zhangzq71 wrote:
    I tried the Callback sample today on two gateway machines that both have 2 ethernet interface card, one for internet connection another for internal network, and the internal IP of that 2 gateway are both 192.168.0.1.

    Now one gateway runs the server another runs the client, here is the server trace,
    ...
    Please notice the red text, I think the 192.168.0.1 is the IP of that gateway running client, but I did not specified this IP in the config file, I used the internet IP for the -h option in both side.

    Is this a bug or I don't understand how to deploy this sample ?

    And in client side, the port 2326 is in listening mode,
    TCP macrohard:2326 macrohard:0 LISTENING 1492
    TCP macrohard:2330 macrohard:0 LISTENING 1492
    1492 is the client PID.

    What configuration information are you running with exactly? Can you post the contents of "config" please? My guess is that you didn't add the -h <ip> to one of the endpoints correctly, and since you are using a multi-homed system the OS picked the wrong endpoint again.

    I just tested this by running the server with the default configuration, and adding -h <ip> in the Callback.Client.CallbackServer property in the client configuration and the same worked as expected. However, my machines don't have two ethernet cards :)

    Best Regards, Matthew
  • The config file

    Matthew,

    I knew the problem, here is the config file

    Callback.Client.CallbackServer=callback:tcp -h nti.gzharvest.cn -p 10000:udp -h nti.gzharvest.cn -p 10000:ssl -h nti.gzharvest.cn -p 10001
    Callback.Client.Endpoints=tcp:udp:ssl
    Callback.Server.Endpoints=tcp -h host.gzharvest.cn -p 10000:udp -h host.gzharvest.cn -p 10000:ssl -h host.gzharvest.cn -p 10001

    Callback.Client.Endpoints=tcp:udp:ssl does not specify the -h option, this will cause the un-predictable IP the socket will bind.


    what option can be used to make the Endpoints bind all ethernet interface ?


    Regards,
    ZhangZQ