equal
deleted
inserted
replaced
29 import java.io.IOException; |
29 import java.io.IOException; |
30 import java.net.*; |
30 import java.net.*; |
31 import java.nio.channels.*; |
31 import java.nio.channels.*; |
32 import java.nio.channels.spi.*; |
32 import java.nio.channels.spi.*; |
33 import java.util.*; |
33 import java.util.*; |
|
34 import sun.net.NetHooks; |
34 |
35 |
35 |
36 |
36 /** |
37 /** |
37 * An implementation of ServerSocketChannels |
38 * An implementation of ServerSocketChannels |
38 */ |
39 */ |
189 InetSocketAddress isa = (local == null) ? new InetSocketAddress(0) : |
190 InetSocketAddress isa = (local == null) ? new InetSocketAddress(0) : |
190 Net.checkAddress(local); |
191 Net.checkAddress(local); |
191 SecurityManager sm = System.getSecurityManager(); |
192 SecurityManager sm = System.getSecurityManager(); |
192 if (sm != null) |
193 if (sm != null) |
193 sm.checkListen(isa.getPort()); |
194 sm.checkListen(isa.getPort()); |
|
195 NetHooks.beforeTcpBind(fd, isa.getAddress(), isa.getPort()); |
194 Net.bind(fd, isa.getAddress(), isa.getPort()); |
196 Net.bind(fd, isa.getAddress(), isa.getPort()); |
195 Net.listen(fd, backlog < 1 ? 50 : backlog); |
197 Net.listen(fd, backlog < 1 ? 50 : backlog); |
196 synchronized (stateLock) { |
198 synchronized (stateLock) { |
197 localAddress = Net.localAddress(fd); |
199 localAddress = Net.localAddress(fd); |
198 } |
200 } |