Page 881 - 3-2
P. 881

public void run() {                   // 클라이언트에서 데이터 받음
               String str;
                try {
                  while (true) {
                    str = din.readUTF();
                    //srv.sendAll(str);
                    if(str.equals("acc")) { srv.sendAll(str); srv.cli=1;}
                    else
                    {
                    if(str.length() >= 9)
                    {
                            if((str.substring(1,8)).equals("_spark_"))
                            {
                                    ServerMain.spark=str.substring(8);
                                    ServerMain.sparknum=Integer.parseInt(str.substring(0,1));
                                    ServerMain.spark();
                            }


                  }
                    if(str.length() >= 8)
                    {
                            if((str.substring(1,6)).equals("_gas_"))
                            {
                                    ServerMain.gas=str.substring(6);


                                    ServerMain.gasnum=Integer.parseInt(str.substring(0,1));
                                    ServerMain.gas();
                            }


                  }if(str.length() >= 10)
                  {
                            if((str.substring(1,9)).equals("_temp: "))
                            {
                                    ServerMain.temp=Float.parseFloat(str.substring(9));


                                    ServerMain.tempnum=Integer.parseInt(str.substring(0,1));
                                    ServerMain.temp();
                            }


                }


                    if(str.length() >= 5)
                    {
                            if((str.substring(0,5)).equals("count"))


                                                         - 881 -
   876   877   878   879   880   881   882   883   884   885   886