Package tk.doraneko.tcp.chat.simple
Class ServerMultiClient
- java.lang.Object
 - 
- tk.doraneko.tcp.chat.simple.ServerMultiClient
 
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description private classServerMultiClient.ServerThreadClass sinh các threads phục vụ từng client 
- 
Field Summary
Fields Modifier and Type Field Description private intportprivate ServerSocketserverSocketprivate ServerMultiClient.ServerThreadserverThreadprivate Threadthread 
- 
Constructor Summary
Constructors Constructor Description ServerMultiClient(int port) 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddThread(Socket socket)static voidmain(String[] args)Main funcprivate voidopen()voidrun()private voidstart()private voidstop() 
 - 
 
- 
- 
Field Detail
- 
serverSocket
private ServerSocket serverSocket
 
- 
thread
private Thread thread
 
- 
serverThread
private ServerMultiClient.ServerThread serverThread
 
- 
port
private int port
 
 - 
 
- 
Constructor Detail
- 
ServerMultiClient
public ServerMultiClient(int port) throws IOException- Throws:
 IOException
 
 - 
 
- 
Method Detail
- 
open
private void open() throws IOException- Throws:
 IOException
 
- 
start
private void start()
 
- 
stop
private void stop()
 
- 
addThread
private void addThread(Socket socket) throws IOException
- Throws:
 IOException
 
- 
main
public static void main(String[] args) throws IOException
Main func- Parameters:
 args- Start Server with serverPort = args[0] or by default serverPort = 16057- Throws:
 IOException
 
 - 
 
 -