Skip to content

write EPIPE #13204

Closed
Closed

Description

  • Version: v7.10.0
  • Platform: Linux vultr-1 3.16.0-4-amd64 deps: update openssl to 1.0.1j #1 SMP Debian 3.16.43-2 (2017-04-30) x86_64 GNU/Linux
  • Subsystem: Unsure what this means.

Hi there. I have an application using ws and express. When spam refreshing a page, this error will occur:

Error: write EPIPE
    at exports._errnoException (util.js:1050:11)
    at WriteWrap.afterWrite [as oncomplete] (net.js:814:14)

I have established that the issue is being caused by the library ws, but I have not reported this issue there as there is no evidence in this stack trace to suggest it is being caused by this library. The error seems to be exclusively produced by this snippet:

ws.broadcast = (data) => {
  ws.clients.forEach((client) => {
    if(client && client.readyState === WebSocket.OPEN) 
      client.send(data);
  });
};

Thanks.

Activity

  1. bnoordhuis commented on May 24, 2017

    @bnoordhuis
    Member

    Can you post support questions to https://github.com/nodejs/help/issues? EPIPE means the other end closed the connection. That's something your application (or ws) needs to handle, node.js core just passes on the event from the operating system.

  2. timi-liuliang commented on Nov 16, 2017

    @timi-liuliang

    It looks like you are using Jsmpeg library like me. you can add code

       socket.on('error', function(e){	
    	console.log(e)
       });
    

    to the WebSocket server.

    I have tested it. The server runs ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidIssues and PRs that are invalid.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions