node.js - nodejs 如何传递一个类的实例?
PHP中文网
PHP中文网 2017-04-17 15:03:25
0
2
586

我目前想用net模块,创建服务端和客户端,但是传递的数据都是经过JSON转换的。这样没法传递一个对象。

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(2)
伊谢尔伦

new will be fine. Even if you pass it, you are passing it a pointer, that is, an address reference, which is not as good as new. In addition, you can pass functions, which are just objects. What you said is not very clear, just leave it at that

Ty80

How can nodejs instances be passed to net. No matter it is node or anything else, it should not be passed. The communication between them is to test json

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template