@Nullable
    public Connection getConnection() {
        return conn;
    }
Returns the connection associated with this Session.

Note that null can be returned, for example when the session is detached.

@return The connection for this session
xmppserver/src/main/java/org/jivesoftware/openfire/session/LocalSession.java