1 Lỗi phần extends Mon Oct 14, 2013 3:11 pm
1101817
Vịt mới lớn
Server đọc số. Bị lỗi phần extends không biết vì sao ... :'( phần client thì đúng rồi không báo lỗi chỉ báo mỗi phần server. Ad xem rồi cho ý kiến dùm mình nhé
package vidu_1;
/**
*
* @author Administrator
*/
import java.net.*;
import java.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;
class PhucVuDocSo extends Thread {
Socket s;
PhucVuDocSo(Socket s1){
s = s1;
}
};
class Server_DocSo_new {
public static void main(String[] args) {
try {
// Tạo server socket
ServerSocket ss = new ServerSocket(3000);
while(true){
// Chấp nhận cho nối kết
Socket s = ss.accept();
System.out.println("+++ Có 1 client nối kết +++");
PhucVuDocSo pv = new PhucVuDocSo(s);
pv.start();
}14.10.2013
} catch (IOException ex) {
System.out.println(" Có lỗi khi tạo Server Socket ");
}
}
}
package vidu_1;
/**
*
* @author Administrator
*/
import java.net.*;
import java.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;
class PhucVuDocSo extends Thread {
Socket s;
PhucVuDocSo(Socket s1){
s = s1;
}
};
class Server_DocSo_new {
public static void main(String[] args) {
try {
// Tạo server socket
ServerSocket ss = new ServerSocket(3000);
while(true){
// Chấp nhận cho nối kết
Socket s = ss.accept();
System.out.println("+++ Có 1 client nối kết +++");
PhucVuDocSo pv = new PhucVuDocSo(s);
pv.start();
}14.10.2013
} catch (IOException ex) {
System.out.println(" Có lỗi khi tạo Server Socket ");
}
}
}