Exemple #1
0
 private void closeConnection() {
   Debug.println("NetScan closing connection", 5);
   try {
     if (in != null) in.close();
     if (socket != null) socket.close();
     if (serverSocket != null) {
       serverSocket.close();
     }
   } catch (IOException ioe) {
     ioe.printStackTrace();
   }
 }
Exemple #2
0
 /** Opens this net scan. */
 public void open() throws DbException {
   try {
     if (socket == null) {
       Debug.println("NetScan accepting @ :" + port);
       socket = Utilities.accept(serverSocket);
       Debug.println("NetScan accepted, creating input stream...");
       in = new DataInputStream(socket.getInputStream());
       Debug.println("NetScan opened");
     }
   } catch (IOException ioe) {
     ioe.printStackTrace();
     closeConnection();
     throw new DbException(ioe);
   }
 }