tendria que usar hilos ?
SERVIDOR
Código
public static void main(String[] args) throws IOException {
// TODO code application logic here
ServerSocket servidor_UTEA=new ServerSocket(5000);
System.out.println("Servidor Iniciando");
Socket cliente=servidor_UTEA.accept();
DataInputStream leer=new DataInputStream(cliente.getInputStream());
System.out.println("El mensaje recibido fue : " + leer.readUTF());
cliente.close();
}
CLIENTE
Código
public static void main(String[] args) throws IOException {
// TODO code application logic here
Socket cliente=new Socket("10.0.1.82",5000);
System.out.println("Cliente Iniciado");
DataOutputStream envio=new DataOutputStream(cliente.getOutputStream());
envio.writeUTF("hola amigos del Foro el Hacker.net:");
}










Autor


En línea







) Por ese motivo si utilizas Sockets, debes usar hilos tambien para cada nueva petición, es lo que se llama "forking" de procesos, lo hace cualquier servidor que acepte conexiones de clientes remotos independiente de sus naturaleza.