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8yMDA3L21haWxfemh1aXl1XzIwMDcwODEzLmh0bWwgKQoKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQrXorLh0MLA
yzJHw+K30dPKz+SjqCBodHRwOi8vbWFpbC5zaW5hLmNvbS5jbi9jaG9vc2VNb2RlLmh0bWwgo6k=
Harri Pasanen
2007-08-13 15:49:52 UTC
Permalink
You need to also enable the bidir GIOP in orb.conf.

Harri
There is a client in private network and a server in public
network. The private network use a NAT connected to the public
network.
client(192.168.0.1)---------[192.168.0.2 NAT
200.1.1.2]----------server(200.1.1.1)
Referring to
http://www.omniorb-support.com/pipermail/omniorb-dev/2004-February/
000138.html ? a connection is setup. But callback is not successful.
In log messages, it is said that client send its
address(192.168.0.1) in callback register messages to server and
server use this address in callback. Cause client address is a
private address and server can not resolve it, the callback failed.
How to make server to use gateway address(200.1.1.2) in callback?
Thanks a lot.
-------------------------------------------------------------------
MOTORAZR ?????????V8??????(
http://d1.sina.com.cn/sina/limeng3/mail_zhuiyu/2007/mail_zhuiyu_200
70813.html )
===================================================================
????2G????? http://mail.sina.com.cn/chooseMode.html ?
Privileged or confidential information may be contained in this
message. If you are not the addressee of this message please
notify the sender by return and thereafter delete the message, and
you may not use, copy, disclose or rely on the information
contained in it. Internet e-mail may be susceptible to data
corruption, interception and unauthorised amendment for which Wall
Street Systems does not accept liability. Whilst we have taken
reasonable precautions to ensure that this e-mail and any
attachments have been swept for viruses, Wall Street Systems does
not accept liability for any damage sustained as a result of
viruses. Statements in this message or attachments that do not
relate to the business of Wall Street Systems are neither given
nor endorsed by the company or its Directors.
Privileged or confidential information may be contained in this message. If you are not the addressee of this message please notify the sender by return and thereafter delete the message, and you may not use, copy, disclose or rely on the information contained in it. Internet e-mail may be susceptible to data corruption, interception and unauthorised amendment for which Wall Street Systems does not accept liability. Whilst we have taken reasonable precautions to ensure that this e-mail and any attachments have been swept for viruses, Wall Street Systems does not accept liability for any damage sustained as a result of viruses. Statements in this message or attachments that do not relate to the business of Wall Street Systems are neither given nor endorsed by the company or its Directors.
devmail at sina.com ()
2007-08-14 12:01:24 UTC
Permalink
Following is part of my test code. Please help me checking it. In my case, I need to use ip address to connect server directly.
Thanks
//////////////////////////////////////////////////////////////////////
// Server
int main(int argc, char** argv)
{
  try {
   const char* options[][2] = {
    { "traceLevel", "40" }, 
    { "traceExceptions", "1" },
    { "acceptBiDirectionalGIOP", "1" },
    { "serverTransportRule", "* unix,tcp,bidir" },  
    { "endPoint", "giop:tcp::7788" },
    { 0, 0 }
   };  
 //  Initialise the ORB.
 orb = CORBA::ORB_init(argc, argv,"omniORB4",options);
 {
      //CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
      CORBA::Object_var obj = orb->resolve_initial_references("omniINSPOA");
      PortableServer::POA_var rootpoa = PortableServer::POA::_narrow(obj);
      PortableServer::POAManager_var pman = rootpoa->the_POAManager();
      pman->activate();
      // Create a POA with the Bidirectional policy
      CORBA::PolicyList pl;
      pl.length(1);
      CORBA::Any a;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a <<= BiDirPolicy::BOTH;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pl[0] = orb->create_policy(BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE, a);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PortableServer::POA_var poa = rootpoa->create_POA("bidir", pman, pl);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; server_i* myserver = new server_i();
&nbsp;&nbsp; PortableServer::ObjectId_var myserver_id = PortableServer::string_to_ObjectId("bidirService");
&nbsp;&nbsp; rootpoa->activate_object_with_id(myserver_id, myserver);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PortableServer::ObjectId_var oid = poa->activate_object(myserver);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; obj = myserver->_this();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; myserver->_remove_ref();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CORBA::String_var sior(orb->object_to_string(obj));
&nbsp;&nbsp; cerr <<std::endl<< "id£º'" << (char*) sior << "'" << endl;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; orb->run();
&nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp; cerr << "bd_server: Returned from orb->run()." << endl;
&nbsp;&nbsp;&nbsp; orb->destroy();
&nbsp; }
&nbsp; catch(CORBA::SystemException&) {
&nbsp;&nbsp;&nbsp; cerr << "Caught CORBA::SystemException." << endl;
&nbsp; }
&nbsp; catch(CORBA::Exception&) {
&nbsp;&nbsp;&nbsp; cerr << "Caught CORBA::Exception." << endl;
&nbsp; }
&nbsp; catch(omniORB::fatalException& fe) {
&nbsp;&nbsp;&nbsp; cerr << "Caught omniORB::fatalException:" << endl;
&nbsp;&nbsp;&nbsp; cerr << "&nbsp; file: " << fe.file() << endl;
&nbsp;&nbsp;&nbsp; cerr << "&nbsp; line: " << fe.line() << endl;
&nbsp;&nbsp;&nbsp; cerr << "&nbsp; mesg: " << fe.errmsg() << endl;
&nbsp; }
&nbsp; catch(...) {
&nbsp;&nbsp;&nbsp; cerr << "Caught unknown exception." << endl;
&nbsp; }
&nbsp; return 0;
}
&nbsp;

//////////////////////////////////////////////////////////////////////
//&nbsp; Client
int main(int argc, char** argv)
{
&nbsp; try {
&nbsp;&nbsp; const char* options[][2] = {
&nbsp;&nbsp;&nbsp; { "traceLevel", "40" },&nbsp;
&nbsp;&nbsp;&nbsp; { "traceExceptions", "1" },
&nbsp;&nbsp;&nbsp; { "offerBiDirectionalGIOP", "1" },
&nbsp;&nbsp;&nbsp; { "clientTransportRule", "* unix,tcp,bidir" },&nbsp;
&nbsp;&nbsp;&nbsp; //{ "maxGIOPVerson", "1.2" },&nbsp;
&nbsp;&nbsp;&nbsp; { 0, 0 }
&nbsp;&nbsp; };&nbsp;&nbsp;
&nbsp;&nbsp; std::string srv_add;
&nbsp;&nbsp; std::cerr << "Input server IP£º";
&nbsp;&nbsp; std::getline(std::cin,srv_add);
&nbsp;&nbsp; std::string obj_id("bidirService");
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; Connect using ip address directly
&nbsp;&nbsp; std::string srv_obj_id("corbaloc::");
&nbsp;&nbsp; srv_obj_id.append(srv_add);
&nbsp;&nbsp; srv_obj_id.append(":7788/");&nbsp;
&nbsp;&nbsp; srv_obj_id.append(obj_id);&nbsp;
&nbsp;&nbsp; std::cerr << "Servant£º" << srv_obj_id << std::endl ;
&nbsp;&nbsp; //&nbsp; Initialise the ORB.
&nbsp;&nbsp; CORBA::ORB_var orb = CORBA::ORB_init(argc, argv,"omniORB4",options);
&nbsp;&nbsp;&nbsp; {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CORBA::Object_var obj;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Initialise the POA.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //obj = orb->resolve_initial_references("RootPOA");
&nbsp;&nbsp; obj = orb->resolve_initial_references("omniINSPOA");
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PortableServer::POA_var rootpoa = PortableServer::POA::_narrow(obj);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PortableServer::POAManager_var pman = rootpoa->the_POAManager();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pman->activate();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Create a POA with the Bidirectional policy
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CORBA::PolicyList pl;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pl.length(1);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CORBA::Any a;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a <<= BiDirPolicy::BOTH;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pl[0] = orb->create_policy(BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE, a);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PortableServer::POA_var poa = rootpoa->create_POA("bidir", pman, pl);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Get the reference the server.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; obj = orb->string_to_object(srv_obj_id.c_str());
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //obj = orb->string_to_object(argv[1]);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cb::Server_var server = cb::Server::_narrow(obj);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Register a CallBack object in this process.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cb_i* mycallback = new cb_i();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PortableServer::ObjectId_var oid = poa->activate_object(mycallback);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cb::CallBack_var callback = mycallback->_this();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mycallback->_remove_ref();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; do_register(server, callback, 3,1000);
&nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp; // Clean-up.&nbsp; This also destroys the call-back object.
&nbsp;&nbsp;&nbsp; orb->destroy();
&nbsp; }
&nbsp; catch(CORBA::COMM_FAILURE& ex) {
&nbsp;&nbsp;&nbsp; cerr << "Caught system exception COMM_FAILURE -- unable to contact the " << "object." << endl;
&nbsp; }
&nbsp; catch(CORBA::SystemException&) {
&nbsp;&nbsp;&nbsp; cerr << "Caught a CORBA::SystemException." << endl;
&nbsp; }
&nbsp; catch(CORBA::Exception&) {
&nbsp;&nbsp;&nbsp; cerr << "Caught CORBA::Exception." << endl;
&nbsp; }
&nbsp; catch(omniORB::fatalException& fe) {
&nbsp;&nbsp;&nbsp; cerr << "Caught omniORB::fatalException:" << endl;
&nbsp;&nbsp;&nbsp; cerr << "&nbsp; file: " << fe.file() << endl;
&nbsp;&nbsp;&nbsp; cerr << "&nbsp; line: " << fe.line() << endl;
&nbsp;&nbsp;&nbsp; cerr << "&nbsp; mesg: " << fe.errmsg() << endl;
&nbsp; }
&nbsp; catch(...) {
&nbsp;&nbsp;&nbsp; cerr << "Caught unknown exception." << endl;
&nbsp; }
system("Pause");
&nbsp; return 0;
}

----- Original Message -----
From:David&nbsp;Bellette&nbsp;
To:,&nbsp;
Subject:RE:&nbsp;[omniORB]&nbsp;Callback&nbsp;problem&nbsp;through&nbsp;NAT&nbsp;gateway&nbsp;with&nbsp;Omniorb
Date:07-08-13 17:23:43

To&nbsp;get&nbsp;this&nbsp;scenario&nbsp;working&nbsp;you&nbsp;will&nbsp;need&nbsp;to&nbsp;use&nbsp;bi-direction&nbsp;GIOP.
I've&nbsp;been&nbsp;using&nbsp;this&nbsp;for&nbsp;a&nbsp;few&nbsp;years&nbsp;now&nbsp;very&nbsp;successfully.

David



-----Original&nbsp;Message-----
From:&nbsp;omniorb-list-***@omniorb-support.com
[mailto:omniorb-list-***@omniorb-support.com]&nbsp;On&nbsp;Behalf&nbsp;Of&nbsp;***@sina.com
Sent:&nbsp;Monday,&nbsp;13&nbsp;August&nbsp;2007&nbsp;7:11pm
To:&nbsp;omniorb-***@omniorb-support.com
Subject:&nbsp;[omniORB]&nbsp;Callback&nbsp;problem&nbsp;through&nbsp;NAT&nbsp;gateway&nbsp;with&nbsp;Omniorb

There&nbsp;is&nbsp;a&nbsp;client&nbsp;in&nbsp;private&nbsp;network&nbsp;and&nbsp;a&nbsp;server&nbsp;in&nbsp;public&nbsp;network.&nbsp;The&nbsp;private
network&nbsp;use&nbsp;a&nbsp;NAT&nbsp;connected&nbsp;to&nbsp;the&nbsp;public&nbsp;network.

client(192.168.0.1)---------[192.168.0.2&nbsp;NAT&nbsp;200.1.1.2]----------server(200.1.1.
1)

Referring&nbsp;to
http://www.omniorb-support.com/pipermail/omniorb-dev/2004-February/000138.html
£¬&nbsp;a&nbsp;connection&nbsp;is&nbsp;setup.&nbsp;But&nbsp;callback&nbsp;is&nbsp;not&nbsp;successful.

In&nbsp;log&nbsp;messages,&nbsp;it&nbsp;is&nbsp;said&nbsp;that&nbsp;client&nbsp;send&nbsp;its&nbsp;address(192.168.0.1)&nbsp;in
callback&nbsp;register&nbsp;messages&nbsp;to&nbsp;&nbsp;server&nbsp;and&nbsp;server&nbsp;use&nbsp;this&nbsp;address&nbsp;in&nbsp;callback.
Cause&nbsp;client&nbsp;address&nbsp;is&nbsp;a&nbsp;private&nbsp;address&nbsp;and&nbsp;server&nbsp;can&nbsp;not&nbsp;resolve&nbsp;it,&nbsp;the
callback&nbsp;failed.

How&nbsp;to&nbsp;make&nbsp;server&nbsp;to&nbsp;use&nbsp;gateway&nbsp;address(200.1.1.2)&nbsp;in&nbsp;callback?

Thanks&nbsp;a&nbsp;lot.





-------------------------------------------------------------------
MOTORAZR ϵÁеߞ²Ö®×÷£¬È«ÐÂV8³¬ŽóË«ÆÁÊÖ»ú( http://d1.sina.com.cn/sina/limeng3/mail_zhuiyu/2007/mail_zhuiyu_20070813.html )

===================================================================
×¢²áÐÂÀË2GÃâ·ÑÓÊÏ䣚 http://mail.sina.com.cn/chooseMode.html £©
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070814/ebc24e7c/attachment.htm
Alex Tingle
2007-08-14 14:06:35 UTC
Permalink
Maybe all of the HTML entities in your code are confusing your
compiler?? Look...
Post by devmail at sina.com ()
int main(int argc, char** argv)
{
&nbsp; try {
&nbsp;&nbsp; const char* options[][2] = {
&nbsp;&nbsp;&nbsp; { "traceLevel", "40" },&nbsp;
&nbsp;&nbsp;&nbsp; { "traceExceptions", "1" },
&nbsp;&nbsp;&nbsp; { "acceptBiDirectionalGIOP", "1" },
&nbsp;&nbsp;&nbsp; { "serverTransportRule", "*
unix,tcp,bidir" },&nbsp;&nbsp;
Seriously, is it so hard to configure your mail client to send mails
in plain text format?

-Alex
--
:: Let me solve your problems: http://www.firetree.net/consulting/
:: alex.tingle AT firetree.net +44-7901-552763
Li Yi
2007-08-14 20:36:18 UTC
Permalink
Try to use another mailbox. My sina mailbox seems to be imcompatible with this maillist....

Following is part of my test code. Please help me checking it. In my case, I need to use ip
address to connect server directly.

Thanks

//////////////////////////////////////////////////////////////////////
// Server

int main(int argc, char** argv)
{
try {
const char* options[][2] = {
{ "traceLevel", "40" },
{ "traceExceptions", "1" },
{ "acceptBiDirectionalGIOP", "1" },
{ "serverTransportRule", "* unix,tcp,bidir" },
{ "endPoint", "giop:tcp::7788" },
{ 0, 0 }
};

// Initialise the ORB.
orb = CORBA::ORB_init(argc, argv,"omniORB4",options);

{
//CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
CORBA::Object_var obj = orb->resolve_initial_references("omniINSPOA");
PortableServer::POA_var rootpoa = PortableServer::POA::_narrow(obj);
PortableServer::POAManager_var pman = rootpoa->the_POAManager();
pman->activate();

// Create a POA with the Bidirectional policy
CORBA::PolicyList pl;
pl.length(1);
CORBA::Any a;
a <<= BiDirPolicy::BOTH;
pl[0] = orb->create_policy(BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE, a);

PortableServer::POA_var poa = rootpoa->create_POA("bidir", pman, pl);

server_i* myserver = new server_i();
PortableServer::ObjectId_var myserver_id = PortableServer::string_to_ObjectId("bidirService");
rootpoa->activate_object_with_id(myserver_id, myserver);

PortableServer::ObjectId_var oid = poa->activate_object(myserver);
obj = myserver->_this();
myserver->_remove_ref();

CORBA::String_var sior(orb->object_to_string(obj));
cerr <<std::endl<< "id??'" << (char*) sior << "'" << endl;
orb->run();
}

cerr << "bd_server: Returned from orb->run()." << endl;
orb->destroy();
}
catch(CORBA::SystemException&) {
cerr << "Caught CORBA::SystemException." << endl;
}
catch(CORBA::Exception&) {
cerr << "Caught CORBA::Exception." << endl;
}
catch(omniORB::fatalException& fe) {
cerr << "Caught omniORB::fatalException:" << endl;
cerr << " file: " << fe.file() << endl;
cerr << " line: " << fe.line() << endl;
cerr << " mesg: " << fe.errmsg() << endl;
}
catch(...) {
cerr << "Caught unknown exception." << endl;
}

return 0;
}




//////////////////////////////////////////////////////////////////////
// Client
int main(int argc, char** argv)
{
try {

const char* options[][2] = {
{ "traceLevel", "40" },
{ "traceExceptions", "1" },
{ "offerBiDirectionalGIOP", "1" },
{ "clientTransportRule", "* unix,tcp,bidir" },
//{ "maxGIOPVerson", "1.2" },
{ 0, 0 }
};

std::string srv_add;
std::cerr << "Input server IP??";
std::getline(std::cin,srv_add);
std::string obj_id("bidirService");

// Connect using ip address directly
std::string srv_obj_id("corbaloc::");
srv_obj_id.append(srv_add);
srv_obj_id.append(":7788/");
srv_obj_id.append(obj_id);
std::cerr << "Servant??" << srv_obj_id << std::endl ;
// Initialise the ORB.
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv,"omniORB4",options);

{
CORBA::Object_var obj;

// Initialise the POA.
//obj = orb->resolve_initial_references("RootPOA");
obj = orb->resolve_initial_references("omniINSPOA");
PortableServer::POA_var rootpoa = PortableServer::POA::_narrow(obj);
PortableServer::POAManager_var pman = rootpoa->the_POAManager();
pman->activate();

// Create a POA with the Bidirectional policy
CORBA::PolicyList pl;
pl.length(1);
CORBA::Any a;
a <<= BiDirPolicy::BOTH;
pl[0] = orb->create_policy(BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE, a);

PortableServer::POA_var poa = rootpoa->create_POA("bidir", pman, pl);

// Get the reference the server.
obj = orb->string_to_object(srv_obj_id.c_str());
//obj = orb->string_to_object(argv[1]);
cb::Server_var server = cb::Server::_narrow(obj);

// Register a CallBack object in this process.
cb_i* mycallback = new cb_i();
PortableServer::ObjectId_var oid = poa->activate_object(mycallback);
cb::CallBack_var callback = mycallback->_this();
mycallback->_remove_ref();

do_register(server, callback, 3,1000);

}
// Clean-up. This also destroys the call-back object.
orb->destroy();
}
catch(CORBA::COMM_FAILURE& ex) {
cerr << "Caught system exception COMM_FAILURE -- unable to contact the " << "object." << endl;
}
catch(CORBA::SystemException&) {
cerr << "Caught a CORBA::SystemException." << endl;
}
catch(CORBA::Exception&) {
cerr << "Caught CORBA::Exception." << endl;
}
catch(omniORB::fatalException& fe) {
cerr << "Caught omniORB::fatalException:" << endl;
cerr << " file: " << fe.file() << endl;
cerr << " line: " << fe.line() << endl;
cerr << " mesg: " << fe.errmsg() << endl;
}
catch(...) {
cerr << "Caught unknown exception." << endl;
}
system("Pause");
return 0;
}


----- Original Message -----
From:David Bellette
To:,
Subject:RE: [omniORB] Callback problem through NAT gateway with Omniorb
Date:07-08-13 17:23:43

To get this scenario working you will need to use bi-direction GIOP.
I've been using this for a few years now very successfully.

David



-----Original Message-----
From: omniorb-list-***@omniorb-support.com
[mailto:omniorb-list-***@omniorb-support.com] On Behalf Of ***@sina.com
Sent: Monday, 13 August 2007 7:11pm
To: omniorb-***@omniorb-support.com
Subject: [omniORB] Callback problem through NAT gateway with Omniorb

There is a client in private network and a server in public network. The private
network use a NAT connected to the public network.

client(192.168.0.1)---------[192.168.0.2 NAT 200.1.1.2]----------server(200.1.1.
1)

Referring to
http://www.omniorb-support.com/pipermail/omniorb-dev/2004-February/000138.html
?? a connection is setup. But callback is not successful.

In log messages, it is said that client send its address(192.168.0.1) in
callback register messages to server and server use this address in callback.
Cause client address is a private address and server can not resolve it, the
callback failed.

How to make server to use gateway address(200.1.1.2) in callback?

Thanks a lot.







____________________________________________________________________________________Ready for the edge of your seat?
Check out tonight's top picks on Yahoo! TV.
http://tv.yahoo.com/

Loading...