コード例 #1
0
 public void run() {
   while (true) {
     try {
       String msg = streamIn.readUTF();
       client.handle(AES.decrypt(msg, enc_key));
     } catch (IOException ioe) {
       JOptionPane.showMessageDialog(
           null, ioe.getMessage(), "Listening Error!", JOptionPane.ERROR_MESSAGE);
       client.stop();
     } catch (Exception ex) {
       JOptionPane.showMessageDialog(null, ex.getMessage(), "Error!", JOptionPane.ERROR_MESSAGE);
       client.stop();
     }
   }
 }
コード例 #2
0
 public void open() {
   try {
     streamIn = new DataInputStream(socket.getInputStream());
   } catch (IOException ioe) {
     JOptionPane.showMessageDialog(
         null, ioe.getMessage(), "Error getting input stream: ", JOptionPane.ERROR_MESSAGE);
     client.stop();
   }
 }