ServerSocket s = new ServerSocket(PORT);
System.out.println("Message Server started listening at port " + PORT);
try {
while (true) {
Socket soc = s.accept();
System.out.println("Connected to the client");
try {
//新线程.
new FlowMessHandler(soc);
} catch (IOException e) {
e.printStackTrace();
soc.close();
}
}
} finally {
s.close();
}