HTTP server on Loom
Alan Bateman
Alan.Bateman at oracle.com
Wed Dec 1 11:59:33 UTC 2021
On 01/12/2021 08:28, Jan Kasarda wrote:
> Hi,
>
> I am trying to implement some basic HTTP server on Loom (windows binary
> downloaded from EA). More or less it works as expected. But there is a
> unexpected thing (which may come from my not understanding current
> limitations of Loom):
>
> Just starting Java's HTTP server on port 80 with a simple handler sending
> http code 200 is enough to demonstrate the problem. Simple curl call to
> http://localhost:80 works as expected. In case the URL is changed to https
> server gets blocked. It just hangs. After this call no more calls are
> processed. Not even http onces.
>
> Since this behavior manifests itself only on executor with virtual thread
> factory I am reaching for help here. (In case line with executor in code
> below is commented out this problem is not happening.)
>
> Is there something I can't see and this is expected
I don't think this is anything to do with virtual threads. You've got
the server setup to service HTTP requests. When a client connects then
it will expect to get a "request line", like "GET /index.html HTTP/1.1
... \r\n". When you use curl and specify "https" then it will connect
and do a TLS handshake that starts out with a TLS "client hello"
message. This probably doesn't have \r\n so the server will hang waiting
for the end of line. There are timeout settings if needed but I think
you've missed a step in the server configuration if you want to support
TLS connections.
-Alan
More information about the loom-dev
mailing list