The preferred way is to change the code so that it does not block without checking for cancellation.
Since you cannot change the code, you cannot do this; you either have to live with a background operation (but you can disconnect it from any user interface so that its completion is ignored); or, alternatively, you can try to terminate it (TerminateThread API will roughly terminate any thread, given its descriptor). Termination is not clean, although, as Rob says, any locks held by the thread will be left behind, and any state of the cross-thread protected by such locks may be in a damaged state.
? , RPC (, TCP, - ), , ? . , , , , , .