GWT事件servise浏览器同步问题 [英] GWT event servise browsers synchronization problem

查看:125
本文介绍了GWT事件servise浏览器同步问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实现了非常简单的应用程序,使用gwt和gwt事件服务1.1.1,它将一些信息发送到服务器,并等待特定事件返回。



当应用程序在一个浏览器窗口中打开时,它工作正常。

在一台机器上的两个浏览器窗口(相同浏览器和相同地址:localhost:port / app或ip:port / app)中打开它时,只有一个我的应用程序实例接收事件(UI仅反映一个窗口中的更改)。

当它在两个不同的浏览器中打开,但具有相同的地址(例如,都是localhost:port / app)时,则两个浏览器都会收到事件。当它在同一浏览器的两个窗口中打开,但具有不同的地址(一个是localhost:port / app,第二个是ip:port / app)时,它也是收到事件。



那么,有人可以提供这种行为的任何解释吗?如果有这种问题的解决方法。



在此先感谢您,
Alex。

解决方案

您正在服务器上使用 gwt事件服务,对吗?



他们声称只有一个开放的连接来进行事件聆听。所以他们主动检查一个客户端只有一个发送事件的连接。他们可能使用网络会话来实现这一点。



由于您在两个选项卡中的相同浏览器中打开了相同的URL,因此这两个选项卡共享相同的会话。没有其他办法了。有很多关于此的问题: https://stackoverflow.com/search?q=browser+tabs+session



更新:



gwt-event-服务可以配置为支持多个会话:使用 SessionExtendedConnectionIdGenerator



更新2:



使用像这样的配置文件: http://code.google.com/p/gwteventservice/source/browse/trunk/conf/eventservice.properties?r=265


I have implemented pretty simple application, using gwt and gwt event service 1.1.1, it sends some information to the server and waits for particular event to come back.

When application is opened in one browser window, it works fine.

When it is opened in two browser windows (the same browser and the same address: localhost:port/app or ip:port/app) on one machine, only one instance of my application receives event (UI reflects changes only in one window).

When it is opened in two different browsers, but with the same addresses (for instance, both are localhost:port/app), then both browsers receive events.

When it is opened in two windows of the same browser, but with different addresses (one is localhost:port/app, second is ip:port/app), then it also receives events.

So, could somebody provide any explanation to such behavior? And if is there some kind of workaround for this problem.

Thanks in advance, Alex.

解决方案

You are using gwt event service on the server, right?

They claim to have "Only one open connection for event listening". So they actively check that one client has only one connection for sending events. They probably use web sessions to achieve this.

Since you open the same URL in the same browses in two tabs, this two tabs share the same session. There is no way around it. There are a lot of questions about this: https://stackoverflow.com/search?q=browser+tabs+session

Update:

It seems that gwt-event-service can be configured to support multiple sessions: use SessionExtendedConnectionIdGenerator

Update 2:

Use a config file like this: http://code.google.com/p/gwteventservice/source/browse/trunk/conf/eventservice.properties?r=265

这篇关于GWT事件servise浏览器同步问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆