public void drop(DropReason reason) { bool did_drop = false; if (!dropped) { dropped = true; did_drop = true; if (DroppedEvent != null) { DroppedEvent(this, reason); } } if (did_drop) { transport.close(); } }