Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to detect end of a connection #6

Open
rodrimc opened this issue Oct 9, 2017 · 0 comments
Open

Fails to detect end of a connection #6

rodrimc opened this issue Oct 9, 2017 · 0 comments

Comments

@rodrimc
Copy link
Contributor

rodrimc commented Oct 9, 2017

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant