When using SSL protocol, get IP and port in the program

in Help Center
When I use TCP protocol, I can obtain IP and port dynamically in the following ways:
auto v = adapter->getEndpoints();
auto in1 = v[0]->getInfo();
Ice::TCPEndpointInfoPtr t = Ice::TCPEndpointInfoPtr::dynamicCast(in1);
So how do I get IP and port number when I use SSL Protocol?
Tagged:
0
Best Answers
-
xdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
EndpointInfo uses composition to provide info about the different transports, you can get the TCPEndpoint info by checking the underlying endpoint info, something like
Ice::TCPEndpointInfoPtr getTCPEndpointInfo(const Ice::EndpointInfoPtr& info) { for(Ice::EndpointInfoPtr p = info; p; p = p->underlying) { Ice::TCPEndpointInfoPtr tcpInfo = Ice::TCPEndpointInfoPtr::dynamicCast(p); if(tcpInfo) { return tcpInfo; } } return 0; }
1 -
J_X_Z Member zhouOrganization: PersonalProject: communication ✭
Thank you very much for your help, let me solve the problem
1
Answers
EndpointInfo uses composition to provide info about the different transports, you can get the TCPEndpoint info by checking the underlying endpoint info, something like
Thank you very much for your help, let me solve the problem