File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Distributed Java and the fly likes Any way to get underlying RMI Socket? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Any way to get underlying RMI Socket?" Watch "Any way to get underlying RMI Socket?" New topic

Any way to get underlying RMI Socket?

Alvin Watkins
Ranch Hand

Joined: May 25, 2011
Posts: 53
I have an RMI server talking to a Tomcat server. I now have need to create a Socket for clients that won't work properly with my RMI server. Instead of begging my IT guy to open ports for me and such, is there any way to return the underlying RMI Socket where I can write bytes to its output stream and have clients make a Socket connection there as well?
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

It would help if you described your system (for example "talking to" is an imprecise term which doesn't identify which system is the client and which is the host). And it would help if you described your problem too -- right now you're asking about a proposed solution to this undescribed problem. It may happen (and given your proposed solution it's quite likely) that some other solution might be better. But it's impossible to tell without understanding the problem and its environment.
Alvin Watkins
Ranch Hand

Joined: May 25, 2011
Posts: 53
Thanks Paul. I got this resolved and I can see why my question was not well-formed.

Essentially, I need to have some way to network web-based clients. I have a Tomcat server where I deploy a war file that contains a client for my RMI server. The Tomcat server has a Flex servlet that takes requests, calls my client and returns Java objects to my Flex web-based clients. That works well until you need to start telling web-based clients what to do based on the goings-on in any particular web-based client. I discovered that Flex has a Socket class which would solve my problem if I can bind to that Socket. I figured I would try getting the RMI Socket and using that to write to its OutputStream. However, I then discovered that BlazeDS (the now Apache Flex communications framework) has an asynch listener. It calls an object on the web server which just keeps the connection alive until you're ready to close it. It's really fantastic and has been working wonderfully.

Thanks for your help. Sorry for the confused sounding post.

I agree. Here's the link:
subject: Any way to get underlying RMI Socket?
jQuery in Action, 3rd edition