Skip to content

Fails to detect end of a connection #6

@rodrimc

Description

@rodrimc

The following finalize never executes unless the handler is blocked awaiting an operation in the stream finish.

#include "uv/tcp.ceu"

#define LOCALHOST "0.0.0.0"
#define PORT 8888
#define BACKLOG 128
data UV_TCP_Server_Data;
code/await UV_TCP_Server_Handler (var& UV_Stream client,
                                  var& UV_TCP_Server_Data shared) -> int
do
  do finalize with
    _printf ("finalize\n");
  end
  await FOREVER; //If we change this to awai UV_Stream_Read_N (&client, _) it works.
end

#include "uv/tcp-server.ceu"

par do
    await UV_TCP_Server (LOCALHOST, PORT, BACKLOG, _, _);
with
    var&? UV_TCP_Connect client = spawn UV_TCP_Connect (LOCALHOST, PORT, _);
    await 1s;
    _printf ("close connection\n");
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions