private void cleanupConnection() { Messages.RequestData.resetCounter(); if (sendTh != null) { // if (sendTh.ThreadState == ThreadState.Running || sendTh.ThreadState== ThreadState.Background) // sendTh.Abort(); sendTh = null; } if (receiveTh != null) { // if (receiveTh.ThreadState == ThreadState.Running || receiveTh.ThreadState == ThreadState.Background) // receiveTh.Abort(); receiveTh = null; } if (client != null) { client.Abort(); client = null; } }