Hi
#!/usr/bin/env python
import sys, os
import CORBA, PortableServer
import Fortune, Fortune__POA
FORTUNE_PATH = "/usr/games/fortune"
class CookieServer_i (Fortune__POA.CookieServer):
def get_cookie(self):
pipe = os.popen(FORTUNE_PATH)
cookie = pipe.read()
if pipe.close():
# An error occurred with the pipe
raise Fortune.Failure("popen of fortune failed")
return cookie
# By default, listen on port 2809, the default corbaloc port, so
# clients can access the object with corbaloc::host.name/fortune
if "-ORBendPoint" not in sys.argv:
sys.argv.extend(["-ORBendPoint", "giop:tcp::2809"])
orb = CORBA.ORB_init(sys.argv)
poa = orb.resolve_initial_references("omniINSPOA")
servant = CookieServer_i()
poa.activate_object_with_id("fortune", servant)
poa._get_the_POAManager().activate()
orb.run()
Maybe i don't understand you but 2809 seems pretty much a specific port..
Post by DESCOMBES ThierryThis solution is not acceptable for my application: I need to use a
specific TCP port (and only one)...
It should be possible to "force the object key", on the servant side,
(before or after instantiation) no ? It would be "cross-orb" capable, and
smarter...
Thanks
Or there's another way, avoiding the use of those and being cross-orb
Post by Thomas ZumbiehlYou juste need to stringify the top servant's IOR, create a socket on the
server within a separate thread before entering the ORB's run method (which
is blocking). That thread should wait for connections, send the stringified
IOR, close the socket and get back on waiting.
That work for me fine for several years now, with both java and C++ clients.
This avoids you from implementing a name service. The only things the
clients should now is the name ou address and port number of the server.
Thomas Zumbiehl
CTO
BV Associates
http://www.bvassociates.fr
-----Message d'origine-----
Envoy? : mardi 16 f?vrier 2010 16:16
? : OmniORB Support
Objet : Re: [omniORB] connecting a servant without IOR parameter (just
IPaddress and TCP port) ?
Post by DESCOMBES ThierryHello,
Quite all is in the mail subject... I need to develop a network
application client/server "easy to deploy".
Is it easily possible to develop such an application with the omniORB
API, which can connect a servant directly, just using an IP adress and a TCP
port (and maybe some others static informations...) ?
Check the docs (and mailing list archives) for "corbaname" and "corbaloc".
br,
Martin
_______________________________________________
omniORB-list mailing list
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
_______________________________________________
omniORB-list mailing list
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
_______________________________________________
omniORB-list mailing list
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
--
Alberto Casado.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20100216/f9be19e4/attachment-0001.htm