title: java.lang.IllegalStateException: failed to create a child event loop
body: <p>I just use Elasticsearch 5.0.0 Java API to search index, then the results of the searching do come out. But at end the problem occur also.   </p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalStateException: failed to create a child event loop
      at io.netty.util.concurrent.MultithreadEventExecutorGroup.&lt;init&gt;(MultithreadEventExecutorGroup.java:88)
      at io.netty.util.concurrent.MultithreadEventExecutorGroup.&lt;init&gt;(MultithreadEventExecutorGroup.java:58)
      at io.netty.util.concurrent.MultithreadEventExecutorGroup.&lt;init&gt;(MultithreadEventExecutorGroup.java:47)
      at io.netty.channel.MultithreadEventLoopGroup.&lt;init&gt;(MultithreadEventLoopGroup.java:58)
      at io.netty.channel.nio.NioEventLoopGroup.&lt;init&gt;(NioEventLoopGroup.java:77)
      at io.netty.channel.nio.NioEventLoopGroup.&lt;init&gt;(NioEventLoopGroup.java:72)
      at io.netty.channel.nio.NioEventLoopGroup.&lt;init&gt;(NioEventLoopGroup.java:59)
      at org.elasticsearch.transport.netty4.Netty4Transport.createBootstrap(Netty4Transport.java:200)
      at org.elasticsearch.transport.netty4.Netty4Transport.doStart(Netty4Transport.java:171)
      at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:68)
      at org.elasticsearch.transport.TransportService.doStart(TransportService.java:182)
      at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:68)
      at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:169)
      at org.elasticsearch.client.transport.TransportClient.&lt;init&gt;(TransportClient.java:228)
      at org.elasticsearch.transport.client.PreBuiltTransportClient.&lt;init&gt;(PreBuiltTransportClient.java:69)
      at org.elasticsearch.transport.client.PreBuiltTransportClient.&lt;init&gt;(PreBuiltTransportClient.java:65)
      at util.ESUtil.getTransportClient(ESUtil.java:27)
      at core.KKId2KKGeo.convertKKId2KKGeo(KKId2KKGeo.java:57)
      at core.KKId2KKGeo.main(KKId2KKGeo.java:83)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
  Caused by: io.netty.channel.ChannelException: failed to open a new selector
      at io.netty.channel.nio.NioEventLoop.openSelector(NioEventLoop.java:157)
      at io.netty.channel.nio.NioEventLoop.&lt;init&gt;(NioEventLoop.java:148)
      at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:126)
      at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:36)
      at io.netty.util.concurrent.MultithreadEventExecutorGroup.&lt;init&gt;(MultithreadEventExecutorGroup.java:84)
  ... 23 more
  Caused by: java.io.IOException: Unable to establish loopback connection
      at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:94)
      at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:61)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.nio.ch.PipeImpl.&lt;init&gt;(PipeImpl.java:171)
      at sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:50)
      at java.nio.channels.Pipe.open(Pipe.java:155)
      at sun.nio.ch.WindowsSelectorImpl.&lt;init&gt;(WindowsSelectorImpl.java:127)
      at sun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:44)
      at io.netty.channel.nio.NioEventLoop.openSelector(NioEventLoop.java:155)
  ... 27 more
  Caused by: java.net.SocketException: No buffer space available (maximum connections reached?): connect
      at sun.nio.ch.Net.connect0(Native Method)
      at sun.nio.ch.Net.connect(Net.java:454)
      at sun.nio.ch.Net.connect(Net.java:446)
      at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:648)
      at java.nio.channels.SocketChannel.open(SocketChannel.java:189)
      at sun.nio.ch.PipeImpl$Initializer$LoopbackConnector.run(PipeImpl.java:127)
      at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:76)
  ... 35 more
  </code></pre>
  
  <p>this some code that I write to search something through ES 5.0.0 java API :    </p>
  
  <pre><code>TransportClient client = new PreBuiltTransportClient(Settings.EMPTY)
                  .addTransportAddress(new      InetSocketTransportAddress(InetAddress.getByName("localhost"), 9300));
  QueryBuilder qb = QueryBuilders.queryStringQuery(d_kkid);
                  SearchResponse searchResponse =   client.prepareSearch("kkinfo_index")
                      .setScroll(new TimeValue(60000))
                      .setQuery(qb)
                      .setSize(10).execute().actionGet();
  </code></pre>