0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Node.jsからSignalRサーバへ接続する

Posted at

概要

Node.jsのSignalRクライアントを利用してサーバへ接続しにいく手順を、.NETのSignalRクライアントと比較します。

参照

C#
using Microsoft.AspNet.SignalR.Client;
Node.js
var signalR = require('signalr-client')

クライアント作成

C#
var connection = new HubConnection("http://xxxx.xx.xx/");
var proxy = connection.CreateHubProxy("MyHub");
Node.js
var client = new signalR.client("http://xxxx.xx.xx/signalR", ['MyHub'])

コネクション→プロキシ と生成するか クライアントを生成するか。という点と、
サーバサイドを置いているURL指定時にsignalRが入る点が違います。

起動

C#
proxy.Invoke("MyMethod")
Node.js
result = client.invoke('MyHub', 'MyMethod')

Node.jsは再度Hubの名称を指定します。

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?