简体   繁体   English

GWT客户端与桌面运行的服务器之间的客户端/服务器通信

[英]Client/Server Communication Between GWT Client and a Desktop-run Server

I'm attempting to write a browser based MMO using libGDX and it's HTML5/GWT port and I have no idea how to do the client/server interactions. 我正在尝试使用libGDX编写基于浏览器的MMO,它是HTML5 / GWT端口,我不知道如何进行客户端/服务器交互。 I have already written the application for desktop as a sort of "learning" project for myself, and have now decided to rewrite it into the browser. 我已经为自己编写了桌面应用程序作为一种“学习”项目,现在决定将其重写到浏览器中。

I have never done browser development before, so I'm not quite sure of how to go about doing the networking portion of the project. 我以前从未做过浏览器开发,所以我不太清楚如何去做项目的网络部分。 I fear that this is because I'm not quite sure as to how GWT actually works, especially when being used for what I'm doing. 我担心这是因为我不太确定GWT实际上是如何工作的,特别是在用于我正在做的事情时。 I attempted to use a library called KryoNet for the networking but apparently you cannot use normal networking methods for GWT. 我试图使用名为KryoNet的库来进行网络连接,但显然你不能使用普通的网络方法来实现GWT。 I received this error: http://pastebin.com/DVJPA44N 我收到了这个错误: http//pastebin.com/DVJPA44N

In short, I need help/direction with how to do a client/server communications type deal with GWT if it's even possible. 简而言之,如果可能的话,我需要帮助/指导如何与GWT进行客户端/服务器通信类型处理。 If there is an easy google answer I apologize, I'm not sure how to word what I'm looking for. 如果有一个简单的谷歌回答我道歉,我不知道如何说出我正在寻找的东西。

Thank you! 谢谢!


EDIT: I looked at the WebSockets API, and that's not quite what I'm looking for. 编辑:我查看了WebSockets API,这不是我正在寻找的。 I want to host a server locally off the desktop and communicate to the client hosted in the browser. 我想在桌面本地托管服务器,并与浏览器中托管的客户端进行通信。 I apologize if I'm just misunderstanding the whole servlet setup in GWT. 如果我只是误解了GWT中的整个servlet设置,我很抱歉。

Did you have look at something like PlayN ( Angry Birds is top example using it with GWT for Browser port of the application ) 您是否看过类似PlayN的内容 (“愤怒的小鸟”是使用GWT for the Application端口的顶级示例)

Also you need to checkout WebSocket API ( either direct use in GWT/JSNI or via third-party gwt jar ) 您还需要签出WebSocket API(直接在GWT / JSNI中使用或通过第三方gwt jar)

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

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