简体   繁体   English

Socket.io服务器无法正常工作

[英]Socket.io server not working

I've got a Socket.io server that is not working (it shows the following error on Firebug and of course it doesn't any of its functions): 我有一个不起作用的Socket.io服务器(它在Firebug上显示以下错误,当然它没有任何功能):

GET http://www.example.com:1618/socket.io/1/?t=1401400488401 400 Bad Request 35ms

Also, when I try to run the server, it outputs that: 另外,当我尝试运行服务器时,它输出:

events.js:72
    throw er; // Unhandled 'error' event
          ^
Error: listen EADDRINUSE
 at errnoException (net.js:904:11)
 at Server._listen2 (net.js:1042:14)
 at listen (net.js:1064:10)
 at net.js:1146:9
 at asyncCallback (dns.js:68:16)
 at Object.onanswer [as oncomplete] (dns.js:121:9)

I am running it on Ubuntu 14.04 我在Ubuntu 14.04上运行它

EADDRINUSE means that there is another process that is listening to the port you're using for socket.io. EADDRINUSE意味着还有另一个进程正在侦听您用于socket.io的端口。 Try changing the port number for socket.io when listen() is called. 尝试在调用listen()时更改socket.io的端口号。

On ubuntu, you might need to run it with sudo: 在ubuntu上,您可能需要使用sudo运行它:

sudo nodejs your_server.js 须藤nodejs your_server.js

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM