Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Quiz_Server;
- import java.net.*;
- import java.io.*;
- /*public ServerSocket(int port, int backlog) throws IOException
- Similar to the previous constructor, the backlog parameter specifies
- how many incoming clients to store in a wait queue.*/
- public class Server
- {
- public static final int PORT=4444;
- public void runServer() throws IOException, ClassNotFoundException
- {
- ServerSocket serverSocket = new ServerSocket(PORT);
- System.out.println("Serwer czeka na klientow");
- while(true){
- Socket socket = serverSocket.accept();
- new ServerThread(socket).start();
- }
- }
- public static void main(String[] args ) throws IOException, ClassNotFoundException {
- new Server().runServer();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement