-
Notifications
You must be signed in to change notification settings - Fork 390
pipe_echo_server example fails on Windows #60
Comments
i have met this problem before, you should not use "echo.sock" as the second param in uv_pipe_bind function, instead, according to microsoft, try using a name like "\\.\pipe\": uv_pipe_bind(&server, "\\\\.\\pipe\\myepipe") |
Thanks for helping @douxing! |
Thank you @douxing - that was the issue. How do I convert the uv_buf_t to something useful, like a string for example? In the echo_read for the pipe_echo_server example, I am trying to simply print out the buffer received, but half of the buffer always seems to get mangled. Here is what I'm trying to do: void echo_read(uv_stream_t client, ssize_t nread, const uv_buf_t *buf) {
} |
Use this form:
Since the buffer might not be null terminated. |
@saghul I used to add an extra '\0' to buf->base to solve this, thank you for the "%.*s" format! |
I'm getting "Bind error EACCESS" error on the uv_pipe_bind on Windows. IOJS & Node versions 2.3.1, 64-bit Windows 8.1 running under Git Bash.
uv_loop_t *loop;
uv_process_t child_req;
uv_process_options_t options;
bool MyPackage::OpenPipe()
{
loop = uv_default_loop();
uv_pipe_t server;
uv_pipe_init(loop, &server, 0);
signal(SIGINT, remove_sock);
int q;
if ((q = uv_pipe_bind(&server, "echo.sock"))) {
fprintf(stderr, "Bind error %s\n", uv_err_name(q)); // <-- Errors here
return false;
}
... etc ...
It looks like you are using "CreateNamedPipeW" (http://manned.org/CreateNamedPipeW/c4d0b097) under Windows. Is that valid, or do you mean to use "CreatedNamedPipe" (https://msdn.microsoft.com/en-us/library/windows/desktop/aa365150(v=vs.85).aspx) instead?
The text was updated successfully, but these errors were encountered: