Skip to content

Commit

Permalink
work in progress #1281
Browse files Browse the repository at this point in the history
  • Loading branch information
gregw committed May 11, 2017
1 parent 861432a commit 3c2ff28
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
10 changes: 7 additions & 3 deletions jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,13 @@ private void processAccept(SelectionKey key)
SelectableChannel channel = null;
try
{
channel = _selectorManager.doAccept(server);
if (channel!=null)
while(true)
{
channel = _selectorManager.doAccept(server);
if (channel==null)
break;
_selectorManager.accepted(channel);
}
}
catch (Throwable x)
{
Expand Down Expand Up @@ -534,7 +538,7 @@ public void run()
{
try
{
SelectionKey key = _channel.register(_selector, SelectionKey.OP_ACCEPT, null);
SelectionKey key = _channel.register(_selector, SelectionKey.OP_ACCEPT, "Acceptor");
if (LOG.isDebugEnabled())
LOG.debug("{} acceptor={}", this, key);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,13 @@ public void open() throws IOException
{
if (_acceptChannel == null)
{
File file = new File(_unixSocket);
file.deleteOnExit();
SocketAddress bindAddress = new UnixSocketAddress(file);
UnixServerSocketChannel serverChannel = UnixServerSocketChannel.open();
SocketAddress bindAddress = new UnixSocketAddress(new File(_unixSocket));
serverChannel.socket().bind(bindAddress, getAcceptQueueSize());

serverChannel.configureBlocking(getAcceptors()>0);
serverChannel.socket().bind(bindAddress, getAcceptQueueSize());
addBean(serverChannel);

LOG.debug("opened {}",serverChannel);
Expand Down Expand Up @@ -287,7 +290,7 @@ public void close()
@Override
public void accept(int acceptorID) throws IOException
{
LOG.warn("Blocking UnixSocket accept used. Cannot be interrupted!");
LOG.debug("Blocking UnixSocket accept used. Might not be able to be interrupted!");
UnixServerSocketChannel serverChannel = _acceptChannel;
if (serverChannel != null && serverChannel.isOpen())
{
Expand Down

0 comments on commit 3c2ff28

Please sign in to comment.