accept « Socket « Java Thread Q&A

Home
Java Thread Q&A
1.concurrency
2.Development
3.Exception
4.Notify
5.Operation
6.Socket
7.State
8.synchronize
9.Thread Safe
10.ThreadPool
Java Thread Q&A » Socket » accept 

1. What happens to an instance of ServerSocket blocked inside accept(), when I drop all references to it?    stackoverflow.com

In a multithreaded Java application, I just tracked down a strange-looking bug, realizing that what seemed to be happening was this:

  • one of my objects was storing a reference to an instance ...

3. using socket.accept() inside of a thread is always freezing    forums.oracle.com

/* try{ clientesActivos.removeElement(this); String historial="C:"+File.separatorChar+"historial.txt"; PrintWriter salidaArchivo=new PrintWriter(new BufferedWriter(new FileWriter(historial,true))); salidaArchivo.println("Desconexion desde la direccion: "+s.getInetAddress().getHostName()+" por el puerto "+s.getPort()); salidaArchivo.close(); }//fin de try catch(IOException e2){ JOptionPane.showMessageDialog(null,"Fallo en el historial"); }//fin de catch finally{ clientesActivos.removeElement(this); } try{ s.close(); }//fin de try catch(Exception e3){ //JOptionPane.showMessageDialog(null, "No se ha podido cerrar el socket",JOptionPane.WARNING_MESSAGE); JOptionPane.showMessageDialog(null,"No se ha podido cerrar el socket"); }//fin de catch }//fin ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.