|
@ -1,14 +1,13 @@ |
|
|
package server; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
import java.io.IOException; |
|
|
import java.net.ServerSocket; |
|
|
import java.net.ServerSocket; |
|
|
import java.net.Socket; |
|
|
import java.net.Socket; |
|
|
|
|
|
|
|
|
public class Server { |
|
|
|
|
|
|
|
|
public class ChatServer { |
|
|
|
|
|
|
|
|
private ServerSocket serverSocket; |
|
|
private ServerSocket serverSocket; |
|
|
|
|
|
|
|
|
public void ChatServer(int port) { |
|
|
|
|
|
|
|
|
public ChatServer(int port) { |
|
|
try { |
|
|
try { |
|
|
serverSocket = new ServerSocket(port); |
|
|
serverSocket = new ServerSocket(port); |
|
|
System.out.println("Started ChatServer on port " + port); |
|
|
System.out.println("Started ChatServer on port " + port); |
|
@ -22,7 +21,7 @@ public class Server { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
public static void main(String[] args) { |
|
|
// TODO Auto-generated method stub |
|
|
|
|
|
|
|
|
new ChatServer(3141); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|