All pastes #615183 Raw Edit

Someone

public java v1 · immutable
·published 2007-07-11 23:52 UTC
rendered paste body
import java.io.*;import java.util.*;import java.net.*;import static java.lang.System.out;class Server {	public static void main(String args[]) {				Scanner myScanner = new Scanner(System.in);				out.println("*********************************");		out.println("*  ChatServ Server v1.0 \"Pyro\"  *");		out.println("*********************************");		out.println();		out.println("Establishing server socket...");		ServerSocket serverSocket = null;				try {    		serverSocket = new ServerSocket(72);    		out.println("Server socket established, type Q to disable the server and quit.");    		out.print("> ");    		String quitString = myScanner.next();			while (quitString != "q" || quitString != "Q") {    			out.print("> ");    			quitString = myScanner.next();			}			if (quitString == "q" || quitString == "Q") {    			System.exit(-1);    		}		} catch (IOException e) {			die("Could not listen on port 72!");		}		Socket clientSocket = null;	try {    	clientSocket = serverSocket.accept();	} catch (IOException e) {		die("Could not accept connection!");	}		}		public static void die(String text) {		out.println(text);		System.exit(-1);	}}