FileDocCategorySizeDatePackage
TCPCalcServer.javaAPI DocExample2187Thu Feb 04 16:10:38 GMT 1999None

TCPCalcServer

public class TCPCalcServer extends TCPServer

Fields Summary
ThreadPool
pool
Constructors Summary
TCPCalcServer()

		int numThreads = CPUSupport.getNumProcessors();
		CPUSupport.setConcurrency(numThreads + 5);
		pool = new ThreadPool(numThreads);
	
Methods Summary
public static voidmain(java.lang.String[] args)

		try {
			new TCPCalcServer().startServer(3535);
		} catch (IOException ioe) {
			// Error processing omitted
		}
	
public voidrun(java.net.Socket data)

		try {
			pool.addRequest(new CalcObject(data.getInputStream(),
									data.getOutputStream()));
		} catch (IOException ioe) {
			// Error processing omitted
		}