RMI Callback; reusing established client to server connection (workaround firewall / NAT)

Discussion in 'Java' started by Jo Voordeckers, Sep 11, 2003.

  1. Hello all,

    I'm pretty new to the Java newsgroups so I apologize for dropping this
    into several maybe offtopic groups. I'm sorry!

    So on to my problem... I've come to a point in our RMI application where
    I need to have server callbacks to the client RMI applications. I've
    used the technique where the client passes an UnicastRemoteObject of
    itself to a RMI server method that registers the clientinterface object
    in a Vector. Now when I do this register in my home LAN all works fine
    (callback methods are working), but when I connect from the office to my
    home server the connection stalls at the point of the registermethod
    with the callback object as parameter. No exceptions are thrown, the
    client just freezes but the server keeps running just fine...

    I then found several connection attepts from my home-server's IP to our
    firewall/NAT router at the office originating from the clients RMI
    SSL-connection assigned port. This makes me assume that the callback
    technique in turn opens a new socket from server to client in stead of
    just reusing the established connection.

    Am I right or is my code missing something to prevent the extra
    connection? And if I am right has anyone found a solution other than to
    not use RMI and write to sockets directly?

    --
    Regards,

    Jo Voordeckers
    Imagine-IT.BE
    Jo Voordeckers, Sep 11, 2003
    #1
    1. Advertising

  2. Re: RMI Callback; reusing established client to server connection (work around firewall / NAT)

    "Jo Voordeckers" <> wrote in message
    news:3f60b4d7$0$24165$...
    >
    > Hello all,
    >
    > I'm pretty new to the Java newsgroups so I apologize for dropping this
    > into several maybe offtopic groups. I'm sorry!
    >
    > So on to my problem... I've come to a point in our RMI application where
    > I need to have server callbacks to the client RMI applications. I've
    > used the technique where the client passes an UnicastRemoteObject of
    > itself to a RMI server method that registers the clientinterface object
    > in a Vector. Now when I do this register in my home LAN all works fine
    > (callback methods are working), but when I connect from the office to my
    > home server the connection stalls at the point of the registermethod
    > with the callback object as parameter. No exceptions are thrown, the
    > client just freezes but the server keeps running just fine...
    >
    > I then found several connection attepts from my home-server's IP to our
    > firewall/NAT router at the office originating from the clients RMI
    > SSL-connection assigned port. This makes me assume that the callback
    > technique in turn opens a new socket from server to client in stead of
    > just reusing the established connection.


    Your assumption is correct. RMI tries to open new sockets on the client side
    if you use callbacks.

    > Am I right or is my code missing something to prevent the extra
    > connection? And if I am right has anyone found a solution other than to
    > not use RMI and write to sockets directly?


    There is no solution based on RMI. Your client is hidden behind a firewall.
    Callbacks do not work across firewalls. See
    http://java.sun.com/j2se/1.4.2/docs/guide/rmi/faq.html#firewallBoth

    Consider using application-level proxy (described in the same source).

    Alex Molochnikov
    Gestalt Corporation
    Alex Molochnikov, Sep 12, 2003
    #2
    1. Advertising

  3. Jo Voordeckers

    EJP Guest

    EJP, Sep 15, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Buchan
    Replies:
    5
    Views:
    525
    Alvin Bruney
    Jul 9, 2003
  2. Jules Hoppenbrouwers
    Replies:
    1
    Views:
    4,746
    Jerry Hammond
    Aug 30, 2003
  3. Robert Dodier
    Replies:
    6
    Views:
    2,353
    Matthias Kraft
    Sep 14, 2004
  4. tobias.weih

    RMI app behind NAT firewall

    tobias.weih, Jan 25, 2006, in forum: Java
    Replies:
    1
    Views:
    4,840
    tobias.weih
    Jan 30, 2006
  5. Apu Nahasapeemapetilon

    Established connection aborted and underlying connection closed

    Apu Nahasapeemapetilon, Nov 6, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    198
    Apu Nahasapeemapetilon
    Nov 6, 2006
Loading...

Share This Page