Two ideas occur to me.
You could exec netstat and parse the output looking for the line that uses your local host.
Or you could change the connection to a multi server connection. The enigne provides the remote ip address in the DRIVERCTL metadata field.