@@ -123,34 +123,51 @@ public InputStream getInputStream() throws IOException {
123123 throw new SocketException ("Socket input is shutdown" );
124124 }
125125
126+ System .out .println ("=====start=====" );
127+
126128 Selector selector = Selector .open ();
129+ System .out .println ("=====1=====" );
127130 unixSocketChannel .configureBlocking (false );
131+ System .out .println ("=====2=====" );
128132 unixSocketChannel .register (selector , SelectionKey .OP_READ );
133+ System .out .println ("=====3=====" );
129134 ByteBuffer buffer = ByteBuffer .allocate (256 );
130135
136+ System .out .println ("=====4=====" );
137+
131138 try {
132139 while (true ) {
133140 if (selector .select (timeout ) == 0 ) {
134141 System .out .println ("Timeout (" + timeout + "ms) while waiting for data." );
135142 break ;
136143 }
144+ System .out .println ("=====5=====" );
137145 Iterator <SelectionKey > keyIterator = selector .selectedKeys ().iterator ();
146+ System .out .println ("=====6=====" );
138147 while (keyIterator .hasNext ()) {
148+ System .out .println ("=====7=====" );
139149 SelectionKey key = keyIterator .next ();
150+ System .out .println ("=====8=====" );
140151 keyIterator .remove ();
152+ System .out .println ("=====9=====" );
141153 if (key .isReadable ()) {
154+ System .out .println ("=====10=====" );
142155 int r = unixSocketChannel .read (buffer );
156+ System .out .println ("=====11=====" );
143157 if (r == -1 ) {
158+ System .out .println ("=====12=====" );
144159 unixSocketChannel .close ();
145160 System .out .println ("Not accepting client messages anymore." );
146161 return InputStream .nullInputStream ();
147162 }
148163 }
149164 }
165+ System .out .println ("=====13=====" );
150166 buffer .flip ();
151167 break ;
152168 }
153169 } finally {
170+ System .out .println ("=====14=====" );
154171 selector .close ();
155172 }
156173
0 commit comments