View | Details | Raw Unified | Return to bug 60560
Collapse All | Expand All

(-)a/java/org/apache/tomcat/util/net/NioEndpoint.java (-4 / +10 lines)
Lines 26-31 import java.net.Socket; Link Here
26
import java.net.SocketTimeoutException;
26
import java.net.SocketTimeoutException;
27
import java.nio.ByteBuffer;
27
import java.nio.ByteBuffer;
28
import java.nio.channels.CancelledKeyException;
28
import java.nio.channels.CancelledKeyException;
29
import java.nio.channels.Channel;
29
import java.nio.channels.FileChannel;
30
import java.nio.channels.FileChannel;
30
import java.nio.channels.NetworkChannel;
31
import java.nio.channels.NetworkChannel;
31
import java.nio.channels.SelectionKey;
32
import java.nio.channels.SelectionKey;
Lines 36-42 import java.nio.channels.WritableByteChannel; Link Here
36
import java.util.ConcurrentModificationException;
37
import java.util.ConcurrentModificationException;
37
import java.util.Iterator;
38
import java.util.Iterator;
38
import java.util.concurrent.CountDownLatch;
39
import java.util.concurrent.CountDownLatch;
39
import java.util.concurrent.TimeUnit;
40
 import java.util.concurrent.TimeUnit;
40
import java.util.concurrent.atomic.AtomicInteger;
41
import java.util.concurrent.atomic.AtomicInteger;
41
import java.util.concurrent.atomic.AtomicLong;
42
import java.util.concurrent.atomic.AtomicLong;
42
43
Lines 200-209 public class NioEndpoint extends AbstractJsseEndpoint<NioChannel,SocketChannel> Link Here
200
    @Override
201
    @Override
201
    public void bind() throws Exception {
202
    public void bind() throws Exception {
202
203
203
        serverSock = ServerSocketChannel.open();
204
        Channel ic = System.inheritedChannel();
205
        if(ic instanceof ServerSocketChannel) {
206
            serverSock = (ServerSocketChannel) ic;
207
        } else {
208
            serverSock = ServerSocketChannel.open();
209
            InetSocketAddress addr = (getAddress()!=null?new InetSocketAddress(getAddress(),getPort()):new InetSocketAddress(getPort()));
210
            serverSock.socket().bind(addr,getAcceptCount());
211
        }
204
        socketProperties.setProperties(serverSock.socket());
212
        socketProperties.setProperties(serverSock.socket());
205
        InetSocketAddress addr = (getAddress()!=null?new InetSocketAddress(getAddress(),getPort()):new InetSocketAddress(getPort()));
206
        serverSock.socket().bind(addr,getAcceptCount());
207
        serverSock.configureBlocking(true); //mimic APR behavior
213
        serverSock.configureBlocking(true); //mimic APR behavior
208
214
209
        // Initialize thread count defaults for acceptor, poller
215
        // Initialize thread count defaults for acceptor, poller

Return to bug 60560