comparison rep/channel/REPSelectionKey.java @ 437:2c00fa39dd84

minor fix
author one
date Fri, 03 Sep 2010 10:22:39 +0900
parents c5be84d53c7f
children
comparison
equal deleted inserted replaced
436:5e3532db2e07 437:2c00fa39dd84
74 @Override 74 @Override
75 public Selector selector() { 75 public Selector selector() {
76 return selector; 76 return selector;
77 } 77 }
78 78
79 @SuppressWarnings("unchecked")
80 public REPSocketChannel<P> accept(REPPack<P> pack) throws IOException { 79 public REPSocketChannel<P> accept(REPPack<P> pack) throws IOException {
81 assert(!REPServerSocketChannel.isSimulation); 80 assert(!REPServerSocketChannel.isSimulation);
82 if (!key.isAcceptable()) throw new IOException(); 81 if (!key.isAcceptable()) throw new IOException();
83 ServerSocketChannel ssc = (ServerSocketChannel)key.channel(); 82 ServerSocketChannel ssc = (ServerSocketChannel)key.channel();
84 if (ssc==null) return null; 83 if (ssc==null) return null;
85 SocketChannel ss = (SocketChannel)ssc.accept(); 84 SocketChannel ss = (SocketChannel)ssc.accept();
86 //System.err.println("Accept in SelectionKey "+ss); 85 //System.err.println("Accept in SelectionKey "+ss);
87 if (ss==null) return null; 86 if (ss==null) return null;
88 return new REPSocketChannel(ss, pack); 87 return new REPSocketChannel<P>(ss, pack);
89 } 88 }
90 89
91 90
92 } 91 }