No, that's not possible, other than terminating the connection by force (but that would require a different thread and it then has to access objects from another thread, not really best practises).
If you want to terminate a long operation, make sure the timeout is set properly, e.g. to 30 seconds (which is the default).