J2ME中文教程 7 开发无线网络应用程序[37]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

  this.os = os;

  start();

 }

 public synchronized void send(String msg) {

  message = msg;

  notify();

 }

 public synchronized void run() {

  while (true) {

   // If no client to deal, wait until one connects

   if (message == null) {

    try {

     wait();

    } catch (InterruptedException e) {

    }

   }

   if (message == null) {

    break;

   }

   try {

    os.write(message.getBytes());

    os.write("\r\n".getBytes());

   } catch (IOException ioe) {

    ioe.printStackTrace();

   }

   // Completed client handling, return handler to pool and

   // mark for wait

   message = null;

  }

 }

 public synchronized void stop() {

本文关键:J2ME中文教程 7 开发无线网络应用程序
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top