comparison src/org/eclipse/jetty/server/nio/SelectChannelConnector.java @ 912:1d0c304e12b5

simplify AggregateLifeCycle
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 08 Oct 2016 22:05:14 -0600
parents c60c1adfac3e
children 17f4fe8271de
comparison
equal deleted inserted replaced
911:cab5830e1ab0 912:1d0c304e12b5
97 97
98 public synchronized void close() throws IOException 98 public synchronized void close() throws IOException
99 { 99 {
100 if (_acceptChannel != null) 100 if (_acceptChannel != null)
101 { 101 {
102 removeBean(_acceptChannel);
103 if (_acceptChannel.isOpen()) 102 if (_acceptChannel.isOpen())
104 _acceptChannel.close(); 103 _acceptChannel.close();
105 } 104 }
106 _acceptChannel = null; 105 _acceptChannel = null;
107 } 106 }
197 InetSocketAddress addr = getHost()==null?new InetSocketAddress(port):new InetSocketAddress(getHost(),port); 196 InetSocketAddress addr = getHost()==null?new InetSocketAddress(port):new InetSocketAddress(getHost(),port);
198 _acceptChannel.bind(addr); 197 _acceptChannel.bind(addr);
199 198
200 if( _acceptChannel.socket().getLocalPort() != port) 199 if( _acceptChannel.socket().getLocalPort() != port)
201 throw new IOException("Server channel not bound"); 200 throw new IOException("Server channel not bound");
202
203 addBean(_acceptChannel);
204 } 201 }
205 202
206 super.doStart(); 203 super.doStart();
207 } 204 }
208 205