We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
服务端的创建代码是: let hproseServer = require("hprose").Server.create('tcp://0.0.0.0:' + rpcPort.toString()); hproseServer.addFunction(WhenRPC, "WhenRPC"); hproseServer.start(); console.info("创建RPC Server", myName, rpcPort);
客户端的创建代码是:
require("hprose").Client.create('tcp://127.0.0.1:' + rpcPort.toString(), ["WhenRPC"])
function WhenRPC (args, callback) { console.info("IN CallRPCAPI", args); //callback(null, "ReceiveSuccess"); callback("ReceiveSuccess"); } require("hprose").Client.WhenRPC("hello",function(){
})
rpcPort 是 Number 数字
The text was updated successfully, but these errors were encountered:
因为需求的原因,每个node进程 会用到 2个tcp端口,但是可以保证 互相独立的,绝对不会冲突
我在怀疑会不会是 多个端口的原因?
另外 server 被客户端连接的时候,有没有对应的 on 事件呢?
Sorry, something went wrong.
你是说你的 rpcPort 是个数组吗?那肯定不行。
另外,你客户端创建了,并没有看到调用。
rpcPort 是数字 而且 代码也调用了 我知道 这样简单的例子 没法让你分析什么,但关键是 我的代码 确实就是非常简单的一段
所以有没有 对应的调试方法呢?让我知道 到底 是 client 链接不成功,还是 server 出错了
比如 client on error 事件?
No branches or pull requests
服务端的创建代码是:
let hproseServer = require("hprose").Server.create('tcp://0.0.0.0:' + rpcPort.toString());
hproseServer.addFunction(WhenRPC, "WhenRPC");
hproseServer.start();
console.info("创建RPC Server", myName, rpcPort);
客户端的创建代码是:
require("hprose").Client.create('tcp://127.0.0.1:' + rpcPort.toString(), ["WhenRPC"])
function WhenRPC (args, callback) {
console.info("IN CallRPCAPI", args);
//callback(null, "ReceiveSuccess");
callback("ReceiveSuccess");
}
require("hprose").Client.WhenRPC("hello",function(){
})
rpcPort 是 Number 数字
The text was updated successfully, but these errors were encountered: