如何使用 ruby 设置计算机网络
我想与我拥有的一些计算机建立一个网络,它们可以连接到一个主要来源,然后接收并向其发送消息。我以前从未做过任何网络编程,所以我只是想知道我可以使用的最好的 Ruby 教程是什么。
提前致谢。
I would like to set up a network with some computers I have, where they can connect to one main source, then receive and send messages back to it. I have never done any network programming before, so I'm just wondering what are the best tutorials using Ruby that I could use.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
大约有十亿种方法可以做到这一点。您能否发布更多有关您要解决的问题是什么,或者内容/目的/大小/格式/等的信息。的消息是?您是在“真正”构建一些东西还是只是想学习网络编程?
另外,你已经弄清楚底层的东西了吗?您有网络基础设施设置、分配的 IP 地址等吗?如果没有,你就需要克服这个困难。一旦掌握了这些,您就可以从 Ruby 中基本套接字编程教程开始,但是- 根据上述问题的答案 - 您可能不想在该级别“推出自己的”解决方案。答案可能是使用 XMPP (Jabber) 服务器,并使用 XMPP 客户端库,或者您可能想要部署类似于 ActiveMQ、HornetQ 等,并使用一个库与之交互。或者您可能想使用 HTTP 并以 JSON、XML 或 $WHATEVER 形式传递消息。简而言之,这个领域有很多选择。
There are about a billion ways you could do this. Could you post more about what the problem is you're trying to solve, or what the content/purpose/size/format/etc. of the messages is to be? Are you building something "for real" or just trying to learn network programming?
Also, do you already have the lower layer stuff figured out? You have networking infrastructure setup, IP addresses assigned, etc? If not, you'll need to get through that. Once you have that, you could start with a tutorial on basic socket programming in Ruby, but - depending on the answers to the questions above - you might not want to "roll your own" solution at that level. The answer might be to use an XMPP (Jabber) server, and use an XMPP client library, or you might want to deploy something like ActiveMQ, HornetQ, etc. and use a library for interfacing with that. Or maybe you want to use HTTP and pass messages around in JSON, or XML or $WHATEVER. In short, there are a LOT of options in this area.