Application变量全局Webgarden [英] Application variables global to Webgarden

查看:233
本文介绍了Application变量全局Webgarden的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在试图编程使用HTML5画布的在线绘图程序。

I am currently trying to program an online drawing program using the HTML5 canvas.

问题是,我需要有当前画布保存全球的某个地方。静态变量的工作,但他们没有得到跨越Webgarden共享。这导致两个不同的附图中被创建。

The thing is, I need to have the current canvas saved somewhere globally. Static variables work, but they do not get shared across a Webgarden. This results in two different drawings being created.

我将不得不以某种方式创建一个共享一个新的应用对象。我想我需要一个外部应用程序持有它们。

I will have to somehow create a new application object which is shared. I figured I will need an external application holding them.

1)我如何用我自己的替代应用对象?

1) How do I replace the application object with my own?

因此​​,无论我将不得不作出自己的方案和远程调用,或使用ASP.NET会话状态的服务器应用程序变量。我虽然赞成会话状态服务器。

So either I will have to make my own program and call to it with remoting or use the ASP.NET session state server for application variables. I favor the Session State Server though.

2)如何我用我自己的变量会话状态服务器?如何访问呢?

2) How do I use the session state server for my own variables? How do I access it?

我搜索高和低在互联网上,只发现上面提到的想法,但没有帮助执行它们。

I searched high and low on the internet and only found the ideas mentioned above, but no help executing them.

我主要是code在VB.NET,但我也能理解C#code的例子。

I mainly code in VB.NET, but I can also understand C# code for examples.

这是我的应用程序提供一些信息:

A little info on my application:

客户端侧具有在彼此的顶部的两个帆布对象。我们用于绘制的东西顶Canvas对象,它下面的画布对象持有到底图。

The client side has two canvas objects on top of each other. The top canvas object us used for drawing stuff, the canvas object below it holds the drawing in the end.

当某物被绘制时,它被发送到在它的的base64重新presentation服务器。 (getDataUri)

When something is drawn, it is sent to the server in it's base64 representation. (getDataUri)

服务器通过一个图形对象,把这个图形上存储位图对象的顶部。

The server puts this graphic on top of a stored Bitmap object through a Graphics object.

如何变化正在分发到其他客户端,我认为现在工作。任我转完整的图片或每一个提交的变化。应通过服务器推送工作。如果这不摸底工作,我将不得不保存和时间戳的变化。

How the changes are being distributed to the other clients, I am working on that right now. Either I transfer the complete picture or each and every change that is submitted. This should work through Server Push. If this does not work thoroughly I will have to save and timestamp changes.

到当前实现,当前未读取更改的链接(但他们得到转移到服务器...随着一些达到一个实例有的达到在任W3WP另外在webgarden问题),并从服务器在这里: http://anno.sinni800.ath.cx/Canvas/Collab

A link to the current implementation, which is not currently fetching changes (but they get transfered to the server... With the problem that some reach one instance some reach the other on either w3wp in the webgarden) from the server is here: http://anno.sinni800.ath.cx/Canvas/Collab

推荐答案

另一种选择是使用分布式缓存如memcached的。

Another option is to use a distributed cache such as memcached.

的Memcached的Windows 结果
使用Memchached用asp.net

这篇关于Application变量全局Webgarden的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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