public void initconfig() {
        BufferedReader bin;
        boolean foundcmd;
        String[] str;
        String cfile;

        cfile = fileName;
        mytotmsg = 0;
        
        // determine self process id
        mypid = Integer.parseInt(cfile.substring("Server".length(),cfile.indexOf(".")));

        try {
            bin = new BufferedReader(new FileReader(cfile));
            rline = bin.readLine();
            str = rline.split(" ");
            numservers = Integer.parseInt(str[0]);
            numBooks = Integer.parseInt(str[1]);

            sa = new sAddress[numservers+1];
            lm = new lamportMutex();
            
            // get list of server addresses
            for (int i=1; i<=numservers; i++) {
                rline = bin.readLine();
                str = rline.split(":");
                sa[i] = new sAddress (str[0], str[1]);
            }
            
            // read rest of the file & command for this server
            rline = bin.readLine();
            foundcmd = false;
            while ((rline != null) && !foundcmd) { 
                str = rline.split(" ");
                if (str[0].equals("s"+Integer.toString(mypid)) &&
                        (str.length >= 2)) {
                    foundcmd = true;
                    mykmsg = Integer.parseInt(str[1]);
                    myunrespt = Integer.parseInt(str[2]);
                }
                rline = bin.readLine();
            }
            
            if (!foundcmd) { // no command for this server
                mykmsg = 0;
                myunrespt = 0;         
            }
            
        } catch (java.io.IOException e) {
            System.out.println(e);
        }      

    }