- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我手动应用了这个补丁,现在一切正常。等待上游解决这个问题 https://github.com/LearnBoost/socket.io-client/pull/361/files
我只是尝试遵循给出的示例并尝试使其正常工作。
模拟服务器.js:
var io = require('socket.io').listen(8000);
io.sockets.on('connection', function(client) {
console.log('+ new client');
client.on('disconnect', function() {
console.log('- lost a client');
});
});
模拟客户端.js:
var io = require('socket.io-client');
var socket = new io.connect('localhost', { port: 8000 });
socket.on('connect', function() {
console.log('connected');
});
socket.on('message', function(data) {
console.log(data);
});
然后我在另一个终端上运行这些与 Node Mockserver.js 和 Node Mockclient.js 的对
info - socket.io started
debug - client authorized
info - handshake authorized 14797776461130411158
debug - setting request GET /socket.io/1/websocket/14797776461130411158
debug - set heartbeat interval for client 14797776461130411158
debug - client authorized for
debug - websocket writing 1::
+ new client
debug - set close timeout for client 14797776461130411158
***************************** error occurs here ****************
info - socket error Error: write EPIPE
at errnoException (net.js:632:11)
at Object.afterWrite [as oncomplete] (net.js:470:18)
****************************************************************
debug - setting request GET /socket.io/1/xhr-polling/14797776461130411158?t=1325912082073
debug - setting poll timeout
debug - discarding transport
debug - cleared close timeout for client 14797776461130411158
debug - cleared heartbeat interval for client 14797776461130411158
debug - clearing poll timeout
info - transport end
debug- set close timeout for client 14797776461130411158
debug - cleared close timeout for client 14797776461130411158
此时我停止了 Mockclient.js
- lost a client
debug - discarding transport
“node Mockclient.js”的唯一输出是
The "sys" module is now called "util". It should have a similar interface.
是什么导致套接字异常?我可能遗漏了一些非常明显的东西。另外,其他人可以尝试我的代码来查看他们的机器上是否也有错误吗? socket.on('connect'... 中的代码也没有触发。我不完全知道为什么。
最佳答案
关于javascript - "Error: write EPIPE"与 node.js 上的 Socket.io,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8767517/
我不断收到 EPIPE 错误,在标准输入流上,我找不到原因: 这是我的代码: var checkFile = function(data, callback){ var child_proces
我目前正在测试我的网络代码。这涉及通过 IPv4 环回地址 (127.0.0.1) 建立连接。不幸的是,程序经常(并非总是)在发送数据时给出 EPIPE 错误。 我正在使用伯克利网络套接字和 libe
我有一个 C socket 客户端程序,其中一个线程用于接收数据,另一个用于发送。如果服务器关闭,则发送者会收到EPIPE。如果我重新连接同一个套接字,那么它可以接收数据,但发送者仍然会收到EPIPE
通过调用 signal() 忽略 SIGPIPE 后,write() 调用可能会失败,errno 设置为等于 EPIPE。我是否仍需要像下面的示例那样关闭文件描述符? if (write(sock_f
我正在尝试使用 JavaPhoenixChannels ( https://github.com/eoinsha/JavaPhoenixChannels ) 连接自定义聊天服务器。 我连接套接字并抛出
我不断收到以下错误: Error: write EPIPE at errnoException (net.js:901:11) at Object.afterWrite (net.js:718:19)
我的代码有问题,但我不知道 E 日志报告在哪里 04-08 05:47:46.745: E/Upload Server(20080): Starting : /storage/sdcard1/Mus
我的代码有问题,但我不知道 E 日志报告在哪里 04-08 05:47:46.745: E/Upload Server(20080): Starting : /storage/sdcard1/Mus
我用C写了一个运行在Linux上的单线程异步服务器:套接字是非阻塞的,至于轮询,我使用的是epoll。基准测试显示服务器运行良好,根据 Valgrind 的说法,没有内存泄漏或其他问题。 唯一的问题是
if @block rd, wr = IO.pipe @pid = fork do $0 = "Forked child from Page #{@path}" rd.clos
我有一个 Broken pipe (Errno::EPIPE) 错误弹出,我不明白它是什么或如何修复它。完整的错误是: example.rb:19:in `write': Broken pipe (E
我有一个在谷歌计算上运行的 nginx-gunicorn-flask 设置 我不断从 gunicorn 得到以下信息: [2019-04-19 20:50:49 +0000] [3345] [DEBU
我使用 html-pdf 模块生成 pdf,使用以下代码: var ejs = require('ejs'); var fs = require('fs'); var pdf = require('h
我在我的 iOS 应用程序中遇到了 EPIPE 问题,并且它没有被 @try/@catch/@finally block 捕获。我怎样才能捕捉到这个信号(SIGPIPE,可能)...... 我已经在我
我只是练习一些关于 child_process @the link 的 node js 代码我的 Node 版本是 Windows 7 上的 V5.2.0。 // master.js var cp=r
我正在创建一些客户端套接字软件来从服务器读取事件。 (例如,流媒体股票报价)。 问题: .read(b); 立即返回值-1。这会导致无限循环,手机会变得很热。此外,对 s.isConnected()、
我正在使用 Node.JS + Mongoose + MongoDB。直到现在我的应用程序运行正常,现在尝试保存文档时: 保存操作: doc.save(function(err, d){ co
我有一个由 node.js 服务器加上其他文件和 HTML 文件组成的应用程序。HTML 文件是我的客户端,它必须与 node.js 服务器通信。node.js 服务器使用与其他 node.js 文件
我在 GNU/Linux 下用 C 语言编程的多线程服务器中有这种奇怪的行为。当它正在发送数据时,最终会被 SIGPIPE 中断。因此,我设法忽略了 send() 中的信号并在每次操作后处理 errn
我试图以编程方式截取 Android 屏幕的屏幕截图。我已经完成了以下代码: private void getsnap(){ try{ Process sh = Runtime
我是一名优秀的程序员,十分优秀!