简体   繁体   English

流星WebSockets(通过DDP?)

[英]Meteor WebSockets (via DDP?)

I'm working on a simple game, that needs to use Web Sockets. 我正在开发一个简单的游戏,需要使用Web套接字。 I have read that DDP should be the way to go, as it's what Meteor uses. 我已经读过DDP应该是要走的路,因为它是Meteor所使用的。

I can't find any documentation regarding it tho, except the note on Meteor.com . 除了Meteor.com上注释,我找不到与此有关的任何文档。

Should I use sock js instead, or how can I use the DDP package? 我应该使用sock js还是应该使用DDP包?

DDP is a protocol that can run on top of sockets. DDP是可以在套接字顶部运行的协议。 It's not a socket library in itself. 它本身不是套接字库。 If you really need your own socket communication, then use socket.io or look for packages that do that on atmosphere. 如果您确实需要自己的套接字通信,请使用socket.io或寻找可以在大气中进行通信的软件包。 There have been some attempts made (eg, http://arunoda.github.io/meteor-streams/ ), but I'm not sure what the latest is on that. 已经进行了一些尝试(例如, http://arunoda.github.io/meteor-streams/ ),但是我不确定最新的内容。 This might work for you: https://github.com/joncursi/socket-io-client 这可能对您有用https : //github.com/joncursi/socket-io-client

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

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