Page 568 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 568

}

                                       }

                                 }


                            }

                            if  (D)  Log.i(TAG,  "END  mAcceptThread, socket  Type:  "  +  mSocketType);

                       }

                       public void  cancel() {

                            if  (D)  Log.d(TAG, "Socket Type" + mSocketType + "cancel " + this);


                            try {

                                 mmServerSocket.close();

                            } catch (IOException  e) {

                                 Log.e(TAG,  "Socket  Type"  +

                                                            mSocketType + "close()  of  server  failed",  e);


                            }

                       }

                       public void  write(byte[] out)  {

                            //  Create temporary object

                            BluetoothTestService.ConnectedThread  r;


                            //  Synchronize  a  copy of  the  ConnectedThread

                            synchronized  (this) {

                                 if  (mState  !=  STATE_CONNECTED)  return;

                                 r = mConnectedThread;

                            }


                            //  Perform  the  write  unsynchronized

                            //try{

                            r.write(out[0]);




                                                         -  561  -
   563   564   565   566   567   568   569   570   571   572   573