相关疑难解决方法(0)

如何修复错误:在使用nodejs时听EADDRINUSE?

如果我运行端口80的服务器,并尝试使用xmlHTTPrequest我得到此错误:Error: listen EADDRINUSE

如果我想要请求,当我在端口80上运行服务器时,为什么nodejs有问题呢?对于网络浏览器来说这不是问题:我可以在互联网上冲浪,而服务器正在运行.

服务器是:

  net.createServer(function (socket) {
    socket.name = socket.remoteAddress + ":" + socket.remotePort;
    console.log('connection request from: ' + socket.remoteAddress);
    socket.destroy();
  }).listen(options.port);
Run Code Online (Sandbox Code Playgroud)

请求:

var xhr = new XMLHttpRequest();

xhr.onreadystatechange = function() {
    sys.puts("State: " + this.readyState);

    if (this.readyState == 4) {
        sys.puts("Complete.\nBody length: " + this.responseText.length);
        sys.puts("Body:\n" + this.responseText);
    }
};

xhr.open("GET", "http://mywebsite.com");
xhr.send();
Run Code Online (Sandbox Code Playgroud)

javascript node.js

439
推荐指数
19
解决办法
59万
查看次数

如何杀死僵尸进程

我在前台启动了我的程序(一个守护程序),然后我用它杀了它kill -9,但我得到了一个僵尸,我无法杀死它kill -9.如何杀死僵尸进程?

如果僵尸是一个死的进程(已经被杀死),我如何从输出中删除它ps aux

root@OpenWrt:~# anyprogramd &
root@OpenWrt:~# ps aux | grep anyprogram
 1163 root      2552 S    anyprogramd
 1167 root      2552 S    anyprogramd
 1169 root      2552 S    anyprogramd
 1170 root      2552 S    anyprogramd
10101 root       944 S    grep anyprogram
root@OpenWrt:~# pidof anyprogramd
1170 1169 1167 1163
root@OpenWrt:~# kill -9 1170 1169 1167 1163
root@OpenWrt:~# ps aux |grep anyprogram
 1163 root         0 Z    [cwmpd]
root@OpenWrt:~# kill -9 1163
root@OpenWrt:~# ps aux |grep anyprogram
 1163 …
Run Code Online (Sandbox Code Playgroud)

linux shell ubuntu debian zombie-process

169
推荐指数
5
解决办法
41万
查看次数

标签 统计

debian ×1

javascript ×1

linux ×1

node.js ×1

shell ×1

ubuntu ×1

zombie-process ×1