Archived
This forum has been archived. Please start a new discussion on GitHub.
a question about connection info
As of 3.4, connection info has supported to retrieve remote ip address and remote port directly like:
code in python:
current.con.getInfo().remoteAddress
current.con.getInfo().remotePort
however, i noticed sometimes, those methods couldn't get an appropriated result. I ran a few tests against this point and quickly found out occasionally the remoteAddress was an empty string
and the remotePort was -1 where a positive integer should be there.
I want to know whether this getInfo() is stable to retrieve an ip address or not. I need this for logging purpose.
test environment:
server; win2008. Ice 3.4.1 (python)
Thansk for your help.
code in python:
current.con.getInfo().remoteAddress
current.con.getInfo().remotePort
however, i noticed sometimes, those methods couldn't get an appropriated result. I ran a few tests against this point and quickly found out occasionally the remoteAddress was an empty string
and the remotePort was -1 where a positive integer should be there.
I want to know whether this getInfo() is stable to retrieve an ip address or not. I need this for logging purpose.
test environment:
server; win2008. Ice 3.4.1 (python)
Thansk for your help.
0
Comments
-
Hi,
Yes, you should be able to use the information returned by getInfo(). An empty remote address and a remort port value of -1 indicates that the connection isn't connected anymore.
Cheers,
Benoit.0