Help rqd with OrbixWeb and OrbCurrent please
3 Message(s) by 2 Author(s) originally posted in java corba
| From: apm35 |
Date: Monday, August 20, 2007
|
I am working on a JAVA rewrite of a
C++ CORBA server using Orbix. I am
using OrbixWeb. Clients have the ability to
register and deregister
themselves but not using the kind of
IDL interface you'd expect.
The IDL is legacy and cannot be changed. Instead of the register
method returning a
token that is used in the deregister, a proprietary
extension of Orbix is used to identify the
client . In the C++ version
of Orbix you can get the
file descriptor for the underlying connection
to the client. In OrbixWeb you cannot (please correct me if I am wrong
about this). I tried to use the
socket object instead with the
code
below:
OrbCurrent orbCurrent = _OrbixWeb.Current();
Object socketRef = orbCurrent.get_socket();
Socket socket = (Socket)socketRef;
I then get the IP Address and
port number from the socket and use
these as a form of client id. The trouble is, this doesn't always
work. Sometimes during
testing when I have two clients I seem to get
getting the Socket object for the wrong client. It is as if
OrbixWeb.Current() sometimes returns the wrong value. Can anybody help
please?
Regards,
Andrew Marlow
| From: Mark Woyna |
Date: Monday, August 20, 2007
|
wrote in message:
I am working on a JAVA rewrite of a C++ CORBA server using Orbix. I am
using OrbixWeb. Clients have the ability to register and deregister
themselves but not using the kind of IDL interface you'd expect.
The IDL is legacy and cannot be changed. Instead of the register
method returning a token that is used in the deregister, a proprietary
extension of Orbix is used to identify the client. In the C++ version
of Orbix you can get the file descriptor for the underlying connection
to the client. In OrbixWeb you cannot (please correct me if I am wrong
about this). I tried to use the socket object instead with the code
below:
OrbCurrent orbCurrent = _OrbixWeb.Current();
Object socketRef = orbCurrent.get_socket();
Socket socket = (Socket)socketRef;
I then get the IP Address and port number from the socket and use
these as a form of client id. The trouble is, this doesn't always
work. Sometimes during testing when I have two clients I seem to get
getting the Socket object for the wrong client. It is as if
OrbixWeb.Current() sometimes returns the wrong value. Can anybody help
please?
Regards,
Andrew Marlow
Since you're rewriting the
application in JAVA, do you've to stick
with OrbixWeb? You'd probably get a lot more help/support if you used
JacORB, which has a much larger active community than OrbixWeb.
Can you post the IDL?
Mark
| From: apm35 |
Date: Tuesday, August 21, 2007
|
wrote in message:
wrote in message:
I found out what was wrong. The code below:
> OrbCurrent orbCurrent = _OrbixWeb.Current();
> Object socketRef = orbCurrent.get_socket();
> Socket socket = (Socket)socketRef;
only works if you say:
JAVA.util.Properties props = new JAVA.util.Properties();
props.setProperty("OrbixWeb.IT_MULTI_THREADED_SERVER",
"true");
ORB orb = _OrbixWeb.ORB(ORB.init(args, props));
when you
initialise the ORB.
> I then get the IP Address and port number from the socket and use
> these as a form of client id. The trouble is, this doesn't always
> work. Sometimes during testing when I have two clients I seem to get
> getting the Socket object for the wrong client. It is as if
> OrbixWeb.Current() sometimes returns the wrong value.
It was returning the wrong value due to a race condition. The ORB init
code code above has to be used according to the IONA KnowledgeBase
article at
https://www.iona.com/support/kb/entry!default.jspa?categoryID=3&externalID=1933.942&fromSearchPage=true
Since you're rewriting the application in JAVA, do you've to stick
with OrbixWeb?
Yes. I wish it wasn't so.
You'd probably get a lot more help/support if you used
JacORB, which has a much larger active community than OrbixWeb.
Agreed. That is why when I first started the
development I did use
JacORB. It enabled me to get most of the development done without
having to worry about setting up a commercial installation, checking
that I had got licences, putting in a purchase order then waiting
three months etc etc.
Regards,
Andrew Marlow
Next Message: mapping JAVA => C++ objects