4. mud study InputDriver






package driver;

public class InputDriver extends Thread{
 private ConnectionList connectionList;
 
 public InputDriver(ConnectionList cl) {
  // TODO Auto-generated constructor stub
  connectionList = cl;
  start();
 }
 
 @Override
 public void run() {
  // TODO Auto-generated method stub
  while(true){
   try {
    for(Connection conn : connectionList.getConnectionList()){
     if(conn.getInput().ready()){
      String input = conn.getInput().readLine();
      
      if(input !=null){
       System.out.println("inputDriver : "+input);
       conn.getInputBuffer().addBuff(input);
      }
     }
    }
   } catch (Exception e) {
    // TODO: handle exception
   }
   
   try {
    sleep(5);
   } catch (InterruptedException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
   }
  }
 }
}


=================================================================================================================











































Popular posts from this blog

youtube download

com.gpki.secureweb.GPKISecureWEBException: ErrCode=1507,ErrMsg=[GPKI_CMS_ProcessEnvelopedData] 해당 인증서로는 데이터를 풀 수 없습니다.

rexpert 공식필드(javascript) 점검일 주기 계산