final synchronized void releaseSocket(){
  running=false;
  sender.interrupt();
  outboundMessages.clear();
  if (socket != null) {
    socket.close();
    socket=null;
  }
  maximumTransmissionUnit=0;
}

final synchronized void releaseSocket ( ) { running = false ; sender . interrupt ( ) ; outboundMessages . clear ( ) ; if ( socket != null ) { socket . close ( ) ; socket = null ; } maximumTransmissionUnit = 0 ; }
stops the sender and receiver threads and closes the socket used for sending and receiving datagrams .
