问题标签 [xsockets.net]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
259 浏览

azure - Azure cloud service project - architecture

I have looked around a lot to wrap my head around the concepts, and now I need to present my plan for some review.

I will create a cloud service that receives notifications from, and consumes REST services of a web API of another company.

The data is processed on behalf of the users that registers on my site. So they make some settings and leave the site. The cloud service now starts to process retrieved data and act upon the web API - some data will be stored for presenting to users.

I'm counting with some thousands to a couple of hundred thousands of notifications per day. Maybe more later. A few hundred users, maybe rising to 1000+ and more later.

So, I'm thinking like this:

Web role:

  • Makes up the front end, takes care of the user managing it's settings and displaying data.
  • stores user credentials and settings in a SQL Database.
  • Also provides the admin UI for managing all users.
  • receives notifications from the web API (containing DTO with data, maximum 20-30 attributes of datatype string mostly), and relays it to a worker role.
  • stores data about the notifications in one (or two) Azure Tables (table 1 and 2).
  • queries these tables (and table 4) to give "mouse over"-data-displayed to users in the web UI.

Worker role A:

  • Receives the relayed notifications from the webrole, evaluates type of notification and:
  • either makes request to REST API for more data or:
  • async'ly puts notification DTO into an Azure Table (table 3) for Worker role B to work on.
  • frequently pops an Azure Queue for jobs created by worker role B, and POSTs to the REST API.
  • stores data about the POSTs in another Azure Table (table 4)

Worker role B:

  • Frequently reads table 3 for notifications with their DTOs
  • Depending on the type of notification, constructs a query with the data in the DTO, queries the SQL Database and retrieves matching user settings, makes evaluations and construct jobs to be put on the Queue, for Worker role A to pop and POST.
  • putting some remaining (not completed) jobs to be continued in another round, in a fifth table (table 5).

This is pretty much the whole thing.

I'm thinking to let the notifications be managed by XSockets.NET, because I think SignalR requires Windows 8, or am I wrong here?

My questions:

  1. Should I use a Service Bus Queue for communication between Web role and Worker role A? Or maybe an internal endpoint? Or a Queue? I'm thinking that constantly polling the queue is unnecessary load, but a ping every second maybe isn't much of work anyway?
  2. Will Service Bus Queue maintain the real time character of the notifications being sent, or will it slow down things?
  3. Can Worker role A be merged with the web role without risking thread dropped by IIS?

The whole thing is pretty much working like this Azure tutorial, where they obviously deem it necessary with 2 worker roles and a web role for that simple task.

Thanks in advance, any tips and clarifying directives are appreciated!

0 投票
2 回答
249 浏览

asp.net - XSockets.net 天蓝色网站

我正在使用 xsockets 在本地运行我的 ASP.NET Web API 应用程序,没有任何问题。当我将项目发布到 Azure 时,它​​不会连接。我为 Azure 启用了 websockets 并在客户端调整了 xsockets url

来自:conn = new XSockets.WebSocket("ws://localhost:50838/api/Chat");

to: conn = new XSockets.WebSocket("ws://.azurewebsites.net/api/Chat");

有什么建议么?

阿诺德

0 投票
2 回答
119 浏览

oracle - 使用 WCF 进行异步

我有一个依赖单向 WCF 服务的 Windows 窗体应用程序;它只是从(Oracle)数据库返回数据。一些客户端对 wcf 的调用是长时间运行的,现在我们需要实现一种异步捕获 Oracle 的 DBMS_output 并将其发送到客户端的方法。如何使用可以连接到 WCF 的 SignalR 或类似方法来实现?我们正在使用 .NET 框架 4.5。

0 投票
1 回答
2886 浏览

asp.net - XSocket.Net - WebSocket 握手期间出错:意外的响应代码:404

我在 .Net 4.5 版中使用 XSocket.Net 进行实时通信。

我对 XSocket.Net 很陌生。

以下是我尝试过的。在 Controller 文件夹中,我使用以下代码创建了 MyController。

以下是根位置的html页面“index.html”

我在控制台(Chrome)中收到错误,在加载 html 时,“与 'ws://localhost:4023/My' 的 WebSocket 连接失败:WebSocket 握手期间出错:意外的响应代码:404”

我不知道我做错了什么。

任何帮助或建议将不胜感激。

0 投票
1 回答
96 浏览

plugins - XSockets 插件框架 AddLocation

Composable.AddLocation 对我不起作用,即使加载了 dll(我可以在输出窗口中看到它),但 GetExport(s) 总是返回 null。我使用了来自http://xsockets.net/docs/the-plugin-framework的标准示例

所以这有效:

但这不会:

所有其他代码都是相同的。

PS这里是解决方案:当我删除XSockets插件框架dll和dll时,Composable.AddLocation开始工作,它描述了Plugins目录中的插件接口。

0 投票
1 回答
517 浏览

xsockets.net - 无法运行 XSockets StockTicker 示例

我正在尝试运行此处找到的 XSockets StockTicker 示例: http ://www.nuget.org/packages/xsockets.sample.stockticker

该软件包安装并显示 StockTicker.html,但是 websockets 服务器似乎没有启动(老实说,我不知道问题可能是什么,我只知道页面没有按应有的方式更新)。

几点注意事项:

1.) 我正在运行 Visual Studio 2013,它似乎仅在 IIS Express 下自托管应用程序。根据应用程序自述文件,我应该在 Visual Studio 开发服务器下运行:

右键单击项目并选择属性。

在“Web”选项卡下,转到“Servers”部分并设置 Use Visual Studio Development Server

这是一个问题,如果是这样 - 如何解决它?

2.) StockTicker.html 包含这一行: conn = new XSockets.WebSocket('ws://127.0.0.1:4502/Stock');

根目录中没有名为“Stock”的类,因此我假设它使用 MVC 约定并引用 Controllers 目录中的 StockController.cs。我修改了这一行,以说明示例包自身的安装位置以及应用程序运行的端口: conn = new XSockets.WebSocket('ws://127.0.0.1:62092/StockTickerSample/Stock');

3.) 我根据自述文件添加了一个 XSocketsBootstrapper。当我在 Start 方法中放置断点时,Visual Studio 告诉我没有加载任何符号并且该方法永远不会执行。这与上面的第 1.) 项有关吗?

我更正了对 jquery 的引用。

0 投票
1 回答
479 浏览

c# - 使用 XSockets.Net 发送大文件

我对 .Net 中的 XSockets 非常陌生。

以下是我的服务器代码。

以下是客户端代码

它适用于小图像和视频,但对于大视频它会失败。有没有更好的方法来传递大文件,例如字节服务或任何东西。

任何指导都会有所帮助。

0 投票
2 回答
1073 浏览

c# - 如何在 XSockets 中使用 C# 客户端 API 获取/设置属性

在 XSockets Server API 中有一个关于如何使用JavaScript API在服务器控制器上获取/设置属性的示例

从客户端 APITop 获取/设置属性

如果您有一个带有公共 getter 或 setter 的属性,您可以从客户端 API 访问 getter/setter 方法

可以从客户端 API(JavaScript 和 C#)检索和更改上面的属性。关于如何从 JavaScript 设置新值的示例

有关更多信息,请参阅客户端 API。

但是客户端 API 页面上没有任何信息

我很难弄清楚 JavaScript 代码的等效 C# 客户端代码是什么conn.publish('set_MyProp',{value:'NewValue'});

非常感谢任何帮助。

0 投票
1 回答
585 浏览

c# - XSockets Client Connecting But Not Receiving Messages

I'm trying to set up a specific scenario but, obviously, I'm having problems. My server is a site that primarily hosts a WCF service but I want to add an XSockets host there as well. I have the standard code in the bootstrap code file as per the instructions in the readme.txt. Upon a client connection, I am starting a worker thread which is basically a heartbeat that the client will monitor. The relevant code from the controller is as follows:

Within my worker thread I am calling this:

Currently I'm testing this with a console client which looks like this:

On the client, if I put a breakpoint in the socketClient_OnOpen method it gets hit so I think it is connecting. But the pump message never makes it to the client.

Two Questions:

  1. Is there anything obvious that I'm missing?
  2. (Unrelated) Since many enterprises really don't like punching holes in their firewalls, is there any way to use port 80 with this setup (so that the client connection would look like "ws://mywebsite/HeartbeatController")?

Thanks for any help!

0 投票
1 回答
108 浏览

xsockets.net - MVC 3 上的 XSocket.Longpolling 回退

这个有一些问题。

MVC3、.NET 4.0、jQuery 1.11.0、XSockets 3.0

客户:

IE8 或 Firefox(websocket=false)

服务器:

IIS Express、Windows 身份验证

结果:

“NetworkError: 404 Not Found - localhost:63360/Fallback/Init?url=ws%3A%2F%2F127.0.0.1%3A4502%2FGeneric%3FXSocketsClientStorageGuid%3D910d22f70cac4843832bd9f14ad9a549&storageGuid=&_=14011104304040”

图片