@aayush350: your code, for what I see, should not even compile, because the anonymous inner class for the Thread cannot "see" the local variable config_datagram .... unless it is marked final (and...