powered by Jive Software

Session's Port Number


#1

Fairly new here, I’m trying to find what port a session was created on so I track down the file descriptor for the socket and not having much luck doing so. I can see the port in the log but can’t seem find what I need to call from inside my SessionEventListener plugin.

Thanks!


#2

Looks like I would need to expose the socket.getLocalPort() in SocketConnection and modify openfire’s code. bummer.


#3

You could always use introspection to avoid modifying code.

https://stackoverflow.com/questions/880365/any-way-to-invoke-a-private-method or
https://stackoverflow.com/questions/1196192/how-to-read-the-value-of-a-private-field-from-a-different-class-in-java