Hello,

First I don't know if I use the appropriate mailing-list. If I look at 
http://hc.apache.org/mail.html , my understanding is that I can't use neither 
HttpComponents Commits list nor HttpComponents Dev list, right ?

I took  a look at http://hc.apache.org/httpcomponents-core-4.4.x/examples.html 
and especially Synchronous HTTP file server.
I use this sample for my own purpose and I don't understand why some lines of 
code are not working.
Basically, I have:

SocketConfig socketConfig = SocketConfig.custom()
    .setSoTimeout(15000)
    .setTcpNoDelay(true)
    .build();

final HttpServer server = ServerBootstrap.bootstrap()
    .setListenerPort(80)
    .setServerInfo("My Server/1.1")
    .setSocketConfig(socketConfig)
    .setExceptionLogger(new StdErrorExceptionLogger())
    .registerHandler("/myurl", new MyURLHandler())
    .create();


try {
  server.start();
  server.awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS);
  System.out.println("Simple HTTP server using Http Core started. Waiting for 
request ...");
} catch (IOException | InterruptedException e) {
  e.printStackTrace();
}

Runtime.getRuntime().addShutdownHook(new Thread() {
  @Override
  public void run() {
    server.shutdown(5, TimeUnit.SECONDS);
  }
});

If I keep server.awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS);, I never saw  
Simple HTTP server using Http Core started. Waiting for request ... message.
Do you know why ?

Best Regards.
________________________________
This message and any attachments are intended solely for the addressees and may 
contain confidential information. Any unauthorized use or disclosure, either 
whole or partial, is prohibited.
E-mails are susceptible to alteration. Our company shall not be liable for the 
message if altered, changed or falsified. If you are not the intended recipient 
of this message, please delete it and notify the sender.
Although all reasonable efforts have been made to keep this transmission free 
from viruses, the sender will not be liable for damages caused by a transmitted 
virus.

Reply via email to