compiling server-client with eclipse
hi. i'm new to java programming and i'm using eclipse. i have 2 simple programmes, one for a server and another for a client and would like to use them to communicate with each other. i have an error message with both programs.. i think that there is a prblem with my server program...is there anything i need to add to get it running or is there anything in particular needed when using eclipse to run server/client programs? here is the code:
import java.io.*;
import java.net.*;
public class Serveur {
public static void main(String[] args) {
try{
ServerSocket ss= new ServerSocket(1500);
Socket sc= ss.accept();
System.out.println("connection etablie");
PrintWriter flux_sortant = new PrintWriter(sc.getOutputStream());
flux_sortant.println("coucou j'ecris");
//ss.close();
//sc.close();
}
catch (IOException e){
System.out.println("Connection non etablie");
}
}
}
and for the client:
import java.io.*;
import java.net.*;
public class Client {
public static void main(String[] args) {
try{
Socket s= new Socket("local host",1500);
BufferedReader flux_entrant= new BufferedReader(new InputStreamReader(s.getInputStream()));
System.out.println("J'ai lu:" + flux_entrant.readLine());
}
catch (IOException e){
System.out.println("probleme de connection");
}
}
}
thanks

