Boa tarde, tenho o código de um servidor e de um cliente que acessa esse servidor, só que o codigo do servidora ta com um erro na hora de compila, o erro acontece na linha numero 34, vou postar aqui o codigo do server, pra ver se alguem consegue me ajudar, desde ja agradeço, obrigado
[code]import java.io.;
import java.net.;
public class MyServer3 extends Thread {
private ServerSocket sock;
public MyServer3(int port) {
super();
try {
sock = new ServerSocket(port);
System.out.println("MyServer running at port " + port);
} catch (IOException e) {
System.out.println("Error: couldn't create socket.");
System.exit(1);
}
}
public void run() {
Socket client = null;
while (true) {
if (sock == null)
return;
try {
client = sock.accept();
// Recebendo identificacao
BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream()));
String c = in.readLine();
System.out.println(c);
// Enviando Informacoes
BufferedOutputStream bos = new BufferedOutputStream(client.getOutputStream());
PrintWriter os = new PrintWriter(bos, false);
os.println(executar(c));
os.flush();
os.close();
client.close();
} catch (IOException e) {
System.out.println("Error: couldn't connect to client.");
System.exit(1);
}
}
}
public String executar (int x) {
int fat,aux;
aux=x;
fat=1;
while (aux>1){
fat = fat*(aux);
aux--;
}
return ("O fatorial de "+x+" é: "+fat);
}
public static void main(String[] arguments) {
int port = 4000;
if (arguments.length == 1) {
port = Integer.parseInt(arguments[0]);
}
MyServer3 server = new MyServer3(port);
server.start();
}
}
[/code]