work in progress #1281

This commit is contained in:
Greg Wilkins 2017-05-11 15:40:02 +02:00
parent 861432a334
commit 3c2ff283a2
2 changed files with 13 additions and 6 deletions

View File

@ -388,9 +388,13 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable
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)
{
@ -534,7 +538,7 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable
{
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);
}

View File

@ -240,10 +240,13 @@ public class UnixSocketConnector extends AbstractConnector
{
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);
@ -287,7 +290,7 @@ public class UnixSocketConnector extends AbstractConnector
@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())
{