Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
sister-kering
IF3230-Tugas-Besar-Sister-2015
Commits
74590d5f
Commit
74590d5f
authored
Apr 21, 2015
by
Rakhmatullah Yoga Sutrisna
Browse files
multiple client listener
parent
1d207214
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/server/GrandQuestServer/src/grandquestserver/GrandQuestServer.java
View file @
74590d5f
...
...
@@ -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);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment