01: import java.io.IOException;
02: import java.net.ServerSocket;
03: import java.net.Socket;
04: 
05: /**
06:    A server that executes the Simple Bank Access Protocol.
07: */
08: public class BankServer
09: {  
10:    public static void main(String[] args ) throws IOException
11:    {  
12:       final int ACCOUNTS_LENGTH = 10;
13:       Bank bank = new Bank(ACCOUNTS_LENGTH);
14:       final int SBAP_PORT = 8888;
15:       ServerSocket server = new ServerSocket(SBAP_PORT);
16:       System.out.println("Waiting for clients to connect...");
17:       
18:       while (true)
19:       {
20:          Socket s = server.accept();
21: 
22:          BankService service = new BankService(s, bank);
23:          service.doService();
24:          s.close();
25:       }
26:    }
27: }
28: 
29: 
30: 
31: 
32: 
33: 
34: 
35: