pomelo.notify问题

pomelo.notify使用总是提示我request超时,pomelo用的最新版,客户端是cocos2d-js版本。

客户单这样写:

pomelo.notify("chat.chatHandler.hello", {
rid: "rid",
content: "msg",
from: "username",
target: "*"
});

服务端这样写:
Handler.prototype.hello = function(msg, session, next) {
};

服务端会出现错误,hello里面的输出都可以, 就是有下面的错误。
[2016-03-13 11:01:34.003] [DEBUG] pomelo - [F:\work\FirstServer\game-server\node
_modules\pomelo\lib\components\connector.js] [connector-server-1] handleMessage
session id: 1, msg: {"id":0,"type":1,"compressRoute":1,"route":"chat.chatHandler
.hello","body":{"rid":"rid","content":"msg","from":"username","target":"*"},"com
pressGzip":0}

[2016-03-13 11:01:37.003] [WARN] pomelo - [F:\work\FirstServer\game-server\node_
modules\pomelo\lib\filters\handler\timeout.js] request "chat.chatHandler.hello"
timeout.

[2016-03-13 11:02:04.020] [WARN] pomelo-rpc - [F:\work\FirstServer\game-server\n
ode_modules\pomelo-rpc\lib\rpc-client\mailboxes\ws-mailbox.js] rpc request is ti
meout, id: 1, host: 192.168.31.174, port: 6055

[2016-03-13 11:02:04.020] [ERROR] pomelo-rpc - [F:\work\FirstServer\game-server\
node_modules\pomelo-rpc\lib\rpc-client\mailboxes\ws-mailbox.js] rpc callback tim
eout, remote server host: 192.168.31.174, port: 6055
[2016-03-13 11:02:04.020] [ERROR] pomelo-rpc - [F:\work\FirstServer\game-server\
node_modules\pomelo-rpc\lib\rpc-client\mailstation.js] [pomelo-rpc] fail to send
message
[2016-03-13 11:02:04.020] [ERROR] pomelo-rpc - [F:\work\FirstServer\game-server\
node_modules\pomelo-rpc\lib\rpc-client\failureProcess.js] rpc failed with error,
remote server: chat-server-1, msg: {"namespace":"sys","serverType":"chat","serv
ice":"msgRemote","method":"forwardMessage","args":[{"id":0,"type":1,"compressRou
te":1,"route":"chat.chatHandler.hello","body":{"rid":"rid","content":"msg","from
":"username","target":""},"compressGzip":0},{"id":1,"frontendId":"connector-ser
ver-1","uid":"username
rid","settings":{"rid":"rid"}}]}, error code: 5
[2016-03-13 11:02:04.020] [ERROR] pomelo - [F:\work\FirstServer\game-server\node
_modules\pomelo\lib\server\server.js] fail to process remote message:Error: rpc
failed with error code: 5
at failfast (F:\work\FirstServer\game-server\node_modules\pomelo-rpc\lib\rpc
-client\failureProcess.js:151:27)
at module.exports (F:\work\FirstServer\game-server\node_modules\pomelo-rpc\l
ib\rpc-client\failureProcess.js:24:10)
at emitMany (events.js:121:13)
at emit (events.js:195:7)
at F:\work\FirstServer\game-server\node_modules\pomelo-rpc\lib\rpc-client\ma
ilstation.js:252:14
at Object.exp.invokeCallback (F:\work\FirstServer\game-server\node_modules\p
omelo-rpc\lib\util\utils.js:5:8)
at null.<anonymous> (F:\work\FirstServer\game-server\node_modules\pomelo-rpc
\lib\rpc-client\mailboxes\ws-mailbox.js:167:11)
at Timer.listOnTimeout (timers.js:92:15)

标签: bug 反馈 开发求助
sss316 在 2016-3-13 11:09发布 分享到 weibo
3 回复
#1 sss316 2016-3-14 21:06 回复

官方能不给给出一个notify 的例子???

#2 {1} kilua 2016-3-17 17:20 回复

服务端要调用next

sss316 2016-3-18 23:15 回复

notify发送,服务器是不用返回的,如果返回,这和request就没有什么区别了

#3 sss316 7-8 10:01 回复

理解错了,next里面不传参数就可以了

回到顶部