Commit 74590d5f authored by Rakhmatullah Yoga Sutrisna's avatar Rakhmatullah Yoga Sutrisna
Browse files

multiple client listener

parent 1d207214
......@@ -9,6 +9,8 @@ package grandquestserver;
import java.io.IOException;
import java.net.ServerSocket;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
/**
*
......@@ -26,9 +28,13 @@ public class GrandQuestServer {
*/
public static void main(String[] args) throws IOException, SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException {
int port = 8000;
List<Thread> clientList = new ArrayList<>();
ServerSocket serverSock = new ServerSocket(port);
Thread t = new ClientHandler(serverSock);
t.start();
while(true) {
Thread t = new ClientHandler(serverSock);
t.start();
clientList.add(t);
}
//DBHandler database = new DBHandler();
//database.addInventory("ardi", 2);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment