try { client.Close(); } catch (CommunicationException e) { client.Abort(); } catch (TimeoutException e) { client.Abort(); } catch (Exception e) { client.Abort(); throw; //Make sure to keep original exception }
http://msdn.microsoft.com/en-us/library/aa355056.aspx