Discussion:
[omniORB] connecting a servant without IOR parameter (just IP address and TCP port) ?
DESCOMBES Thierry
2010-02-16 19:12:03 UTC
Permalink
Hello,
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...) ?
If yes, could someone give me a short example ?
Thanks a lot in advance.
Cheers,
Martin B.
2010-02-16 21:16:08 UTC
Permalink
Post by DESCOMBES Thierry
Hello,
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
Thomas Zumbiehl
2010-02-16 21:28:28 UTC
Permalink
Or there's another way, avoiding the use of those and being cross-orb capable :
You 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-----
De : omniorb-list-***@omniorb-support.com [mailto:omniorb-list-***@omniorb-support.com] De la part de Martin B.
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 Thierry
Hello,
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
DESCOMBES Thierry
2010-02-16 21:53:00 UTC
Permalink
This 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
Post by Thomas Zumbiehl
You 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 Thierry
Hello,
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
Alberto Casado Martín
2010-02-16 22:01:19 UTC
Permalink
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 Thierry
This 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 Zumbiehl
You 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 Thierry
Hello,
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
DESCOMBES Thierry
2010-02-16 21:30:24 UTC
Permalink
Actually, I don't want to use a nameservice ! Is it a way to find my
servant (without copying the whole IOR ;-), just with an IP and a TCP port ?
Thanks a lot. Cheers
Post by Martin B.
Post by DESCOMBES Thierry
Hello,
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
Alberto Casado Martín
2010-02-16 21:53:04 UTC
Permalink
Hi,
As Martin said before, check the documentation for corbaname and corbaloc.
And in the examples that come with omniORBpy, you have an example named
Fortune that use omniINSPOA, that is what you are looking for...

It is pretty easy to figure out how it can be in c++...

Alberto.
Post by DESCOMBES Thierry
Actually, I don't want to use a nameservice ! Is it a way to find my
servant (without copying the whole IOR ;-), just with an IP and a TCP port ?
Thanks a lot. Cheers
Post by Martin B.
Post by DESCOMBES Thierry
Hello,
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
--
Alberto Casado.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20100216/08305e55/attachment.htm
Loading...