XMPP C# Interaction

天涯浪子 提交于 2019-12-03 21:08:12

问题


I am trying to connect via c# and via javascript to an xmpp server (currently ejabberd). Im having a little trouble conceptualizing how the connections will exists.

Backstory: I have a game engine that will take input from the user and send some kind of response back to them. The user may be a windows app, a web app, all needing to connect pretty much the same way. The game engine is a c# application that handles the input accordingly. Is my game engine a user on the xmpp server just like everyone else? How does he talk to the others and vica verca. A detailed tutorial on how this kind of thing is done using xmpp is greatly appreciated if possible.

Are there c# libraries to handle the xmpp connection in the way I specified above? Would the javascript also be hitting the xmpp server in the same way?


回答1:


Your game server would be an XMPP component which your users could directly communicate with, like they can with any other user, server or component in an XMPP system.

Users log into your server (say example.com) in the standard way, then they can start sending messages of whatever type you like directly to your component (game-engine.example.com). Your game engine component exists separately to your XMPP server and the two communicate using the Jabber Component Protocol. Your client can also send directed presence to the component if you want it to be able to initiate communications.

Though, as you're using ejabberd, you could also implement the game engine messaging system as an ejabberd module.

This probably answers your question about a C# XMPP library: https://stackoverflow.com/questions/1166252/net-xmpp-libraries-under-apache-mit-or-ms-pl-licenses



来源:https://stackoverflow.com/questions/2122394/xmpp-c-sharp-interaction

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!