public void stop() throws IOException {
  if (socket != null) {
    socket.close();
  }
}

public void stop ( ) throws IOException { if ( socket != null ) { socket . close ( ) ; } }
stops the module , by closing the tcp socket .
