code: public void setValues(int port, long cookie) throws IOException {
          Assert.check(lock != null);
          rwfile.seek(0);
          // Write the magic nr that identifes a port file.
          rwfile.writeInt(magicNr);
          rwfile.writeInt(port);
          rwfile.writeLong(cookie);
          myServerPort = port;
          myServerCookie = cookie;
      }
docs: Store the values into the locked port file.