├── README.md
└── Src
├── SignalR Android
├── .gitattributes
├── .gitignore
├── .idea
│ ├── compiler.xml
│ ├── copyright
│ │ └── profiles_settings.xml
│ ├── gradle.xml
│ ├── misc.xml
│ ├── modules.xml
│ └── runConfigurations.xml
├── README.md
├── SimpleSignalRClient-master.iml
├── SimpleSignalRClient.iml
├── app
│ ├── .gitignore
│ ├── app.iml
│ ├── build.gradle
│ ├── libs
│ │ ├── gson-2.3.1.jar
│ │ ├── signalr-client-sdk-android.jar
│ │ └── signalr-client-sdk.jar
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── simplesignalrclient
│ │ │ └── ApplicationTest.java
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── simplesignalrclient
│ │ │ ├── CustomMessage.java
│ │ │ ├── MainActivity.java
│ │ │ └── SignalRService.java
│ │ └── res
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── menu
│ │ └── menu_main.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
└── SignalR Server
├── .vs
└── config
│ └── applicationhost.config
├── SignalRChat.sln
├── SignalRChat
├── ChatHub.cs
├── Default.html
├── Properties
│ ├── AssemblyInfo.cs
│ └── PublishProfiles
│ │ ├── SignalR.pubxml
│ │ └── SignalR.pubxml.user
├── Scripts
│ ├── jquery-1.6.4-vsdoc.js
│ ├── jquery-1.6.4.js
│ ├── jquery-1.6.4.min.js
│ ├── jquery.signalR-2.0.0.js
│ └── jquery.signalR-2.0.0.min.js
├── SignalRChat.csproj
├── SignalRChat.csproj.user
├── Startup.cs
├── Web.Debug.config
├── Web.Release.config
├── Web.config
├── bin
│ ├── Microsoft.AspNet.SignalR.Core.dll
│ ├── Microsoft.AspNet.SignalR.Core.xml
│ ├── Microsoft.AspNet.SignalR.SystemWeb.dll
│ ├── Microsoft.AspNet.SignalR.SystemWeb.xml
│ ├── Microsoft.Owin.Host.SystemWeb.dll
│ ├── Microsoft.Owin.Host.SystemWeb.xml
│ ├── Microsoft.Owin.Security.dll
│ ├── Microsoft.Owin.Security.xml
│ ├── Microsoft.Owin.dll
│ ├── Microsoft.Owin.xml
│ ├── Microsoft.Web.Infrastructure.dll
│ ├── Newtonsoft.Json.dll
│ ├── Newtonsoft.Json.xml
│ ├── Owin.dll
│ ├── SignalRChat.dll
│ ├── SignalRChat.dll.config
│ └── SignalRChat.pdb
├── obj
│ ├── Debug
│ │ ├── DesignTimeResolveAssemblyReferencesInput.cache
│ │ ├── SignalRChat.csproj.FileListAbsolute.txt
│ │ ├── SignalRChat.dll
│ │ ├── SignalRChat.pdb
│ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
│ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
│ │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
│ └── Release
│ │ ├── DesignTimeResolveAssemblyReferencesInput.cache
│ │ ├── Package
│ │ └── PackageTmp
│ │ │ ├── Default.html
│ │ │ ├── Scripts
│ │ │ ├── jquery-1.6.4.js
│ │ │ ├── jquery-1.6.4.min.js
│ │ │ ├── jquery.signalR-2.0.0.js
│ │ │ └── jquery.signalR-2.0.0.min.js
│ │ │ ├── Web.config
│ │ │ ├── bin
│ │ │ ├── Microsoft.AspNet.SignalR.Core.dll
│ │ │ ├── Microsoft.AspNet.SignalR.SystemWeb.dll
│ │ │ ├── Microsoft.Owin.Host.SystemWeb.dll
│ │ │ ├── Microsoft.Owin.Security.dll
│ │ │ ├── Microsoft.Owin.dll
│ │ │ ├── Microsoft.Web.Infrastructure.dll
│ │ │ ├── Newtonsoft.Json.dll
│ │ │ ├── Owin.dll
│ │ │ └── SignalRChat.dll
│ │ │ └── packages.config
│ │ ├── SignalRChat.csproj.FileListAbsolute.txt
│ │ ├── SignalRChat.csprojResolveAssemblyReference.cache
│ │ ├── SignalRChat.dll
│ │ ├── SignalRChat.pdb
│ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
│ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
│ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
│ │ ├── TransformWebConfig
│ │ ├── assist
│ │ │ └── Web.config
│ │ ├── original
│ │ │ └── Web.config
│ │ └── transformed
│ │ │ └── Web.config
│ │ └── _WPPLastBuildInfo.txt
└── packages.config
└── packages
├── Microsoft.AspNet.SignalR.2.0.0
├── Microsoft.AspNet.SignalR.2.0.0.nupkg
└── readme.txt
├── Microsoft.AspNet.SignalR.Core.2.0.0
├── Microsoft.AspNet.SignalR.Core.2.0.0.nupkg
└── lib
│ └── net45
│ ├── Microsoft.AspNet.SignalR.Core.dll
│ └── Microsoft.AspNet.SignalR.Core.xml
├── Microsoft.AspNet.SignalR.JS.2.0.0
├── Microsoft.AspNet.SignalR.JS.2.0.0.nupkg
└── content
│ └── Scripts
│ ├── jquery.signalR-2.0.0.js
│ └── jquery.signalR-2.0.0.min.js
├── Microsoft.AspNet.SignalR.SystemWeb.2.0.0
├── Microsoft.AspNet.SignalR.SystemWeb.2.0.0.nupkg
└── lib
│ └── net45
│ ├── Microsoft.AspNet.SignalR.SystemWeb.XML
│ └── Microsoft.AspNet.SignalR.SystemWeb.dll
├── Microsoft.Owin.2.0.0
├── Microsoft.Owin.2.0.0.nupkg
└── lib
│ ├── net40
│ ├── Microsoft.Owin.XML
│ └── Microsoft.Owin.dll
│ └── net45
│ ├── Microsoft.Owin.XML
│ └── Microsoft.Owin.dll
├── Microsoft.Owin.Host.SystemWeb.2.0.0
├── Microsoft.Owin.Host.SystemWeb.2.0.0.nupkg
└── lib
│ ├── net40
│ ├── Microsoft.Owin.Host.SystemWeb.dll
│ └── Microsoft.Owin.Host.SystemWeb.xml
│ └── net45
│ ├── Microsoft.Owin.Host.SystemWeb.dll
│ └── Microsoft.Owin.Host.SystemWeb.xml
├── Microsoft.Owin.Security.2.0.0
├── Microsoft.Owin.Security.2.0.0.nupkg
└── lib
│ └── net45
│ ├── Microsoft.Owin.Security.XML
│ └── Microsoft.Owin.Security.dll
├── Microsoft.Web.Infrastructure.1.0.0.0
├── Microsoft.Web.Infrastructure.1.0.0.0.nupkg
└── lib
│ └── net40
│ └── Microsoft.Web.Infrastructure.dll
├── Newtonsoft.Json.5.0.8
├── Newtonsoft.Json.5.0.8.nupkg
├── lib
│ ├── net20
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ ├── net35
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ ├── net40
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ ├── net45
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ ├── netcore45
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ ├── portable-net40+sl4+wp7+win8
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ └── portable-net45+wp80+win8
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
└── tools
│ └── install.ps1
├── Owin.1.0
├── Owin.1.0.nupkg
└── lib
│ └── net40
│ └── Owin.dll
└── jQuery.1.6.4
├── Content
└── Scripts
│ ├── jquery-1.6.4-vsdoc.js
│ ├── jquery-1.6.4.js
│ └── jquery-1.6.4.min.js
├── Tools
├── install.ps1
├── jquery-1.6.4-vsdoc-para.js
└── uninstall.ps1
└── jQuery.1.6.4.nupkg
/README.md:
--------------------------------------------------------------------------------
1 | # SignalRAndroid
2 | SignalR Android Client Server sample
3 |
--------------------------------------------------------------------------------
/Src/SignalR Android/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/Src/SignalR Android/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 | /captures
8 |
--------------------------------------------------------------------------------
/Src/SignalR Android/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/Src/SignalR Android/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Src/SignalR Android/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
--------------------------------------------------------------------------------
/Src/SignalR Android/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/Src/SignalR Android/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Src/SignalR Android/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Src/SignalR Android/README.md:
--------------------------------------------------------------------------------
1 | # SimpleSignalRClient
2 | Simple SignalR Android Client
3 |
4 | #Code Example
5 | ```
6 |
7 | private void startSignalR() {
8 | Platform.loadPlatformComponent(new AndroidPlatformComponent());
9 |
10 | String serverUrl = "http://192.168.1.247:20583";
11 | mHubConnection = new HubConnection(serverUrl);
12 | String SERVER_HUB_CHAT = "ChatHub";
13 | mHubProxy = mHubConnection.createHubProxy(SERVER_HUB_CHAT);
14 | ClientTransport clientTransport = new ServerSentEventsTransport(mHubConnection.getLogger());
15 | SignalRFuture signalRFuture = mHubConnection.start(clientTransport);
16 |
17 | try {
18 | signalRFuture.get();
19 | } catch (InterruptedException | ExecutionException e) {
20 | Log.e("SimpleSignalR", e.toString());
21 | return;
22 | }
23 |
24 | sendMessage("Hello from BNK!");
25 |
26 | String CLIENT_METHOD_BROADAST_MESSAGE = "broadcastMessage";
27 | mHubProxy.on(CLIENT_METHOD_BROADAST_MESSAGE,
28 | new SubscriptionHandler1() {
29 | @Override
30 | public void run(final CustomMessage msg) {
31 | final String finalMsg = msg.UserName + " says " + msg.Message;
32 | // display Toast message
33 | mHandler.post(new Runnable() {
34 | @Override
35 | public void run() {
36 | Toast.makeText(getApplicationContext(), finalMsg, Toast.LENGTH_SHORT).show();
37 | }
38 | });
39 | }
40 | }
41 | , CustomMessage.class);
42 | }
43 |
44 | ```
45 |
46 | [SignalR server-side App - Microsoft's training documentation](http://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr)
47 |
--------------------------------------------------------------------------------
/Src/SignalR Android/SimpleSignalRClient-master.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Src/SignalR Android/SimpleSignalRClient.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Src/SignalR Android/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/Src/SignalR Android/app/app.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | generateDebugSources
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
--------------------------------------------------------------------------------
/Src/SignalR Android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion "23.0.0"
6 |
7 | defaultConfig {
8 | applicationId "com.example.simplesignalrclient"
9 | minSdkVersion 16
10 | targetSdkVersion 23
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(include: ['*.jar'], dir: 'libs')
24 | compile 'com.android.support:appcompat-v7:23.0.1'
25 | compile files('libs/gson-2.3.1.jar')
26 | compile files('libs/signalr-client-sdk-android.jar')
27 | compile files('libs/signalr-client-sdk.jar')
28 | }
29 |
--------------------------------------------------------------------------------
/Src/SignalR Android/app/libs/gson-2.3.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahmadaghazadeh/SignalRAndroid/6ab780949d93f0cc5c1d8e1c795b7715f5aaaa8e/Src/SignalR Android/app/libs/gson-2.3.1.jar
--------------------------------------------------------------------------------
/Src/SignalR Android/app/libs/signalr-client-sdk-android.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahmadaghazadeh/SignalRAndroid/6ab780949d93f0cc5c1d8e1c795b7715f5aaaa8e/Src/SignalR Android/app/libs/signalr-client-sdk-android.jar
--------------------------------------------------------------------------------
/Src/SignalR Android/app/libs/signalr-client-sdk.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahmadaghazadeh/SignalRAndroid/6ab780949d93f0cc5c1d8e1c795b7715f5aaaa8e/Src/SignalR Android/app/libs/signalr-client-sdk.jar
--------------------------------------------------------------------------------
/Src/SignalR Android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\Android\SDK/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/Src/SignalR Android/app/src/androidTest/java/com/example/simplesignalrclient/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.example.simplesignalrclient;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/Src/SignalR Android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
15 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Src/SignalR Android/app/src/main/java/com/example/simplesignalrclient/CustomMessage.java:
--------------------------------------------------------------------------------
1 | package com.example.simplesignalrclient;
2 |
3 | public class CustomMessage {
4 | public String UserName;
5 | public String Message;
6 | }
7 |
--------------------------------------------------------------------------------
/Src/SignalR Android/app/src/main/java/com/example/simplesignalrclient/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.simplesignalrclient;
2 |
3 | import android.content.ComponentName;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.content.ServiceConnection;
7 | import android.os.Bundle;
8 | import android.os.IBinder;
9 | import android.support.v7.app.AppCompatActivity;
10 | import android.view.Menu;
11 | import android.view.MenuItem;
12 | import android.view.View;
13 | import android.widget.EditText;
14 |
15 | public class MainActivity extends AppCompatActivity {
16 |
17 | private final Context mContext = this;
18 | private SignalRService mService;
19 | private boolean mBound = false;
20 |
21 | @Override
22 | protected void onCreate(Bundle savedInstanceState) {
23 | super.onCreate(savedInstanceState);
24 | setContentView(R.layout.activity_main);
25 |
26 | Intent intent = new Intent();
27 | intent.setClass(mContext, SignalRService.class);
28 | bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
29 | }
30 |
31 | @Override
32 | protected void onStop() {
33 | // Unbind from the service
34 | if (mBound) {
35 | unbindService(mConnection);
36 | mBound = false;
37 | }
38 | super.onStop();
39 | }
40 |
41 | @Override
42 | public boolean onCreateOptionsMenu(Menu menu) {
43 | // Inflate the menu; this adds items to the action bar if it is present.
44 | getMenuInflater().inflate(R.menu.menu_main, menu);
45 | return true;
46 | }
47 |
48 | @Override
49 | public boolean onOptionsItemSelected(MenuItem item) {
50 | // Handle action bar item clicks here. The action bar will
51 | // automatically handle clicks on the Home/Up button, so long
52 | // as you specify a parent activity in AndroidManifest.xml.
53 | int id = item.getItemId();
54 |
55 | //noinspection SimplifiableIfStatement
56 | if (id == R.id.action_settings) {
57 | return true;
58 | }
59 |
60 | return super.onOptionsItemSelected(item);
61 | }
62 |
63 | public void sendMessage(View view) {
64 | if (mBound) {
65 | // Call a method from the SignalRService.
66 | // However, if this call were something that might hang, then this request should
67 | // occur in a separate thread to avoid slowing down the activity performance.
68 | EditText editText = (EditText) findViewById(R.id.edit_message);
69 | EditText editText_Receiver = (EditText) findViewById(R.id.edit_receiver);
70 | if (editText != null && editText.getText().length() > 0) {
71 | String receiver = editText_Receiver.getText().toString();
72 | String message = editText.getText().toString();
73 | mService.sendMessage_To(receiver, message);
74 | }
75 | }
76 | }
77 |
78 | public void sendMessageAll(View view) {
79 | if (mBound) {
80 | // Call a method from the SignalRService.
81 | // However, if this call were something that might hang, then this request should
82 | // occur in a separate thread to avoid slowing down the activity performance.
83 | EditText editText = (EditText) findViewById(R.id.edit_message);
84 | EditText editText_Receiver = (EditText) findViewById(R.id.edit_receiver);
85 | if (editText != null && editText.getText().length() > 0) {
86 | String receiver = editText_Receiver.getText().toString();
87 | String message = editText.getText().toString();
88 | mService.sendMessage_To(receiver, message);
89 | }
90 | }
91 | }
92 |
93 | /**
94 | * Defines callbacks for service binding, passed to bindService()
95 | */
96 | private final ServiceConnection mConnection = new ServiceConnection() {
97 |
98 | @Override
99 | public void onServiceConnected(ComponentName className,
100 | IBinder service) {
101 | // We've bound to SignalRService, cast the IBinder and get SignalRService instance
102 | SignalRService.LocalBinder binder = (SignalRService.LocalBinder) service;
103 | mService = binder.getService();
104 | mBound = true;
105 | }
106 |
107 | @Override
108 | public void onServiceDisconnected(ComponentName arg0) {
109 | mBound = false;
110 | }
111 | };
112 | }
113 |
--------------------------------------------------------------------------------
/Src/SignalR Android/app/src/main/java/com/example/simplesignalrclient/SignalRService.java:
--------------------------------------------------------------------------------
1 | package com.example.simplesignalrclient;
2 |
3 | import android.app.Service;
4 | import android.content.Intent;
5 | import android.os.Binder;
6 | import android.os.Handler;
7 | import android.os.IBinder;
8 | import android.os.Looper;
9 | import android.util.Log;
10 | import android.widget.Toast;
11 |
12 | import java.util.concurrent.ExecutionException;
13 |
14 |
15 | import microsoft.aspnet.signalr.client.Platform;
16 | import microsoft.aspnet.signalr.client.SignalRFuture;
17 | import microsoft.aspnet.signalr.client.http.android.AndroidPlatformComponent;
18 | import microsoft.aspnet.signalr.client.hubs.HubConnection;
19 | import microsoft.aspnet.signalr.client.hubs.HubProxy;
20 | import microsoft.aspnet.signalr.client.hubs.SubscriptionHandler2;
21 | import microsoft.aspnet.signalr.client.transport.ClientTransport;
22 | import microsoft.aspnet.signalr.client.transport.ServerSentEventsTransport;
23 |
24 | public class SignalRService extends Service {
25 | private HubConnection mHubConnection;
26 | private HubProxy mHubProxy;
27 | private Handler mHandler; // to display Toast message
28 | private final IBinder mBinder = new LocalBinder(); // Binder given to clients
29 |
30 | public SignalRService() {
31 | }
32 |
33 | @Override
34 | public void onCreate() {
35 | super.onCreate();
36 | mHandler = new Handler(Looper.getMainLooper());
37 | }
38 |
39 | @Override
40 | public int onStartCommand(Intent intent, int flags, int startId) {
41 | int result = super.onStartCommand(intent, flags, startId);
42 | startSignalR();
43 | return result;
44 | }
45 |
46 | @Override
47 | public void onDestroy() {
48 | mHubConnection.stop();
49 | super.onDestroy();
50 | }
51 |
52 | @Override
53 | public IBinder onBind(Intent intent) {
54 | // Return the communication channel to the service.
55 | startSignalR();
56 | return mBinder;
57 | }
58 |
59 | /**
60 | * Class used for the client Binder. Because we know this service always
61 | * runs in the same process as its clients, we don't need to deal with IPC.
62 | */
63 | public class LocalBinder extends Binder {
64 | public SignalRService getService() {
65 | // Return this instance of SignalRService so clients can call public methods
66 | return SignalRService.this;
67 | }
68 | }
69 |
70 | /**
71 | * method for clients (activities)
72 | */
73 | public void sendMessage(String message) {
74 | String SERVER_METHOD_SEND = "send";
75 | mHubProxy.invoke(SERVER_METHOD_SEND, message);
76 | }
77 |
78 | /**
79 | * method for clients (activities)
80 | */
81 | public void sendMessage_To(String receiverName, String message) {
82 | String SERVER_METHOD_SEND_TO = "send";
83 | mHubProxy.invoke(SERVER_METHOD_SEND_TO, receiverName, message);
84 | }
85 |
86 | private void startSignalR() {
87 | Platform.loadPlatformComponent(new AndroidPlatformComponent());
88 |
89 | String serverUrl = "http://192.168.0.196:8099";
90 | mHubConnection = new HubConnection(serverUrl);
91 | String SERVER_HUB_CHAT = "ChatHub";
92 | mHubProxy = mHubConnection.createHubProxy(SERVER_HUB_CHAT);
93 |
94 | ClientTransport clientTransport = new ServerSentEventsTransport(mHubConnection.getLogger());
95 | SignalRFuture signalRFuture = mHubConnection.start(clientTransport);
96 |
97 | try {
98 | signalRFuture.get();
99 | } catch (InterruptedException | ExecutionException e) {
100 | Log.e("SimpleSignalR", e.toString());
101 | return;
102 | }
103 |
104 | sendMessage("Hello from BNK!");
105 |
106 |
107 | String CLIENT_METHOD_BROADAST_MESSAGE = "broadcastMessage";
108 | mHubProxy.on(CLIENT_METHOD_BROADAST_MESSAGE,
109 | new SubscriptionHandler2() {
110 | @Override
111 | public void run(final String name,final String msg) {
112 | final String finalMsg = msg.toString();
113 | // display Toast message
114 | mHandler.post(new Runnable() {
115 | @Override
116 | public void run() {
117 | Toast.makeText(getApplicationContext(), finalMsg, Toast.LENGTH_SHORT).show();
118 | }
119 | });
120 | }
121 | }
122 | , String.class,String.class);
123 |
124 |
125 | // Subscribe to the received event
126 | /* mHubConnection.received(new MessageReceivedHandler() {
127 |
128 | @Override
129 | public void onMessageReceived(final JsonElement json) {
130 | Log.e("onMessageReceived ", json.toString());
131 | mHandler.post(new Runnable() {
132 | @Override
133 | public void run() {
134 | Toast.makeText(getApplicationContext(), json.toString(), Toast.LENGTH_SHORT).show();
135 | }
136 | });
137 | }
138 | });*/
139 |
140 | }
141 |
142 | }
143 |
--------------------------------------------------------------------------------
/Src/SignalR Android/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
18 |
23 |
24 |
25 |
31 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Src/SignalR Android/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/Src/SignalR Android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahmadaghazadeh/SignalRAndroid/6ab780949d93f0cc5c1d8e1c795b7715f5aaaa8e/Src/SignalR Android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Src/SignalR Android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahmadaghazadeh/SignalRAndroid/6ab780949d93f0cc5c1d8e1c795b7715f5aaaa8e/Src/SignalR Android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Src/SignalR Android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahmadaghazadeh/SignalRAndroid/6ab780949d93f0cc5c1d8e1c795b7715f5aaaa8e/Src/SignalR Android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Src/SignalR Android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahmadaghazadeh/SignalRAndroid/6ab780949d93f0cc5c1d8e1c795b7715f5aaaa8e/Src/SignalR Android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Src/SignalR Android/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/Src/SignalR Android/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/Src/SignalR Android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | SimpleSignalRClient
3 |
4 | Hello world!
5 | Settings
6 | To
7 | Message
8 | Send
9 |
10 |
--------------------------------------------------------------------------------
/Src/SignalR Android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Src/SignalR Android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.2.3'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Src/SignalR Android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/Src/SignalR Android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahmadaghazadeh/SignalRAndroid/6ab780949d93f0cc5c1d8e1c795b7715f5aaaa8e/Src/SignalR Android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/Src/SignalR Android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Sep 09 08:18:06 ICT 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
7 |
--------------------------------------------------------------------------------
/Src/SignalR Android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/Src/SignalR Android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/Src/SignalR Android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/Src/SignalR Server/SignalRChat.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.21005.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SignalRChat", "SignalRChat\SignalRChat.csproj", "{5E35FE6D-2AF0-4F7D-80E4-7187F7E40D37}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {5E35FE6D-2AF0-4F7D-80E4-7187F7E40D37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {5E35FE6D-2AF0-4F7D-80E4-7187F7E40D37}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {5E35FE6D-2AF0-4F7D-80E4-7187F7E40D37}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {5E35FE6D-2AF0-4F7D-80E4-7187F7E40D37}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/Src/SignalR Server/SignalRChat/ChatHub.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Web;
3 | using Microsoft.AspNet.SignalR;
4 | namespace SignalRChat
5 | {
6 | public class ChatHub : Hub
7 | {
8 | public void Send(string name, string message)
9 | {
10 | // Call the broadcastMessage method to update clients.
11 | Clients.All.broadcastMessage(name, message);
12 | }
13 |
14 | }
15 | }
--------------------------------------------------------------------------------
/Src/SignalR Server/SignalRChat/Default.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | SignalR Simple Chat
5 |
13 |
14 |
15 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
58 |
59 |
--------------------------------------------------------------------------------
/Src/SignalR Server/SignalRChat/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("SignalRChat")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("SignalRChat")]
13 | [assembly: AssemblyCopyright("Copyright © 2013")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("13991a93-d975-4f0c-bb67-62837fd53e9e")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Src/SignalR Server/SignalRChat/Properties/PublishProfiles/SignalR.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | FileSystem
9 | Release
10 | Any CPU
11 |
12 | True
13 | False
14 | D:\sites\SignalR
15 | False
16 |
17 |
--------------------------------------------------------------------------------
/Src/SignalR Server/SignalRChat/Properties/PublishProfiles/SignalR.pubxml.user:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 | <_PublishTargetUrl>D:\sites\SignalR
10 |
11 |
12 |
13 | 09/04/2013 11:00:02
14 |
15 |
16 | 09/04/2013 11:00:04
17 |
18 |
19 | 09/11/2013 01:49:58
20 |
21 |
22 | 09/11/2013 01:49:56
23 |
24 |
25 | 09/11/2013 01:49:58
26 |
27 |
28 | 07/25/2012 11:48:56
29 |
30 |
31 | 10/17/2013 12:52:10
32 |
33 |
34 | 11/13/2012 12:19:34
35 |
36 |
37 | 03/01/2017 11:57:59
38 |
39 |
40 | 03/01/2017 10:43:17
41 |
42 |
43 | 06/06/2014 05:06:45
44 |
45 |
46 | 06/06/2014 05:06:45
47 |
48 |
49 | 06/06/2014 05:06:45
50 |
51 |
52 | 06/06/2014 05:06:45
53 |
54 |
55 | 06/06/2014 05:06:45
56 |
57 |
58 | 02/28/2017 12:29:50
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Src/SignalR Server/SignalRChat/Scripts/jquery.signalR-2.0.0.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ASP.NET SignalR JavaScript Library v2.0.0
3 | * http://signalr.net/
4 | *
5 | * Copyright (C) Microsoft Corporation. All rights reserved.
6 | *
7 | */
8 | (function(n,t,i){"use strict";function w(t,i){var u,f;if(n.isArray(t)){for(u=t.length-1;u>=0;u--)f=t[u],n.type(t)==="object"||n.type(f)==="string"&&r.transports[f]||(i.log("Invalid transport: "+f+", removing it from the transports list."),t.splice(u,1));t.length===0&&(i.log("No transports remain within the specified transport array."),t=null)}else if(n.type(t)==="object"||r.transports[t]||t==="auto"){if(t==="auto"&&r._.ieVersion<=8)return["longPolling"]}else i.log("Invalid transport: "+t.toString()+"."),t=null;return t}function b(n){return n==="http:"?80:n==="https:"?443:void 0}function l(n,t){return t.match(/:\d+$/)?t:t+":"+b(n)}function k(t,i){var u=this,r=[];u.tryBuffer=function(i){return t.state===n.signalR.connectionState.connecting?(r.push(i),!0):!1};u.drain=function(){if(t.state===n.signalR.connectionState.connected)while(r.length>0)i(r.shift())};u.clear=function(){r=[]}}var f={nojQuery:"jQuery was not found. Please ensure jQuery is referenced before the SignalR client JavaScript file.",noTransportOnInit:"No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.",errorOnNegotiate:"Error during negotiation request.",stoppedWhileLoading:"The connection was stopped during page load.",stoppedWhileNegotiating:"The connection was stopped during the negotiate request.",errorParsingNegotiateResponse:"Error parsing negotiate response.",protocolIncompatible:"You are using a version of the client that isn't compatible with the server. Client version {0}, server version {1}.",sendFailed:"Send failed.",parseFailed:"Failed at parsing response: {0}",longPollFailed:"Long polling request failed.",eventSourceFailedToConnect:"EventSource failed to connect.",eventSourceError:"Error raised by EventSource",webSocketClosed:"WebSocket closed.",pingServerFailedInvalidResponse:"Invalid ping response when pinging server: '{0}'.",pingServerFailed:"Failed to ping server.",pingServerFailedStatusCode:"Failed to ping server. Server responded with status code {0}, stopping the connection.",pingServerFailedParse:"Failed to parse ping server response, stopping the connection.",noConnectionTransport:"Connection is in an invalid state, there is no transport active."};if(typeof n!="function")throw new Error(f.nojQuery);var r,h,s=t.document.readyState==="complete",e=n(t),c="__Negotiate Aborted__",u={onStart:"onStart",onStarting:"onStarting",onReceived:"onReceived",onError:"onError",onConnectionSlow:"onConnectionSlow",onReconnecting:"onReconnecting",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},a=function(n,i){if(i!==!1){var r;typeof t.console!="undefined"&&(r="["+(new Date).toTimeString()+"] SignalR: "+n,t.console.debug?t.console.debug(r):t.console.log&&t.console.log(r))}},o=function(t,i,r){return i===t.state?(t.state=r,n(t).triggerHandler(u.onStateChanged,[{oldState:i,newState:r}]),!0):!1},v=function(n){return n.state===r.connectionState.disconnected},y=function(i){var f=i._.config,e=function(t){n(i).triggerHandler(u.onError,[t])};!f.pingIntervalId&&f.pingInterval&&(i._.pingIntervalId=t.setInterval(function(){r.transports._logic.pingServer(i).fail(e)},f.pingInterval))},p=function(n){var i,u;n._.configuredStopReconnectingTimeout||(u=function(n){n.log("Couldn't reconnect within the configured timeout ("+n.disconnectTimeout+"ms), disconnecting.");n.stop(!1,!1)},n.reconnecting(function(){var n=this;n.state===r.connectionState.reconnecting&&(i=t.setTimeout(function(){u(n)},n.disconnectTimeout))}),n.stateChanged(function(n){n.oldState===r.connectionState.reconnecting&&t.clearTimeout(i)}),n._.configuredStopReconnectingTimeout=!0)};r=function(n,t,i){return new r.fn.init(n,t,i)};r._={defaultContentType:"application/x-www-form-urlencoded; charset=UTF-8",ieVersion:function(){var i,n;return t.navigator.appName==="Microsoft Internet Explorer"&&(n=/MSIE ([0-9]+\.[0-9]+)/.exec(t.navigator.userAgent),n&&(i=t.parseFloat(n[1]))),i}(),error:function(n,t){var i=new Error(n);return i.source=t,i},transportError:function(n,t,r){var u=this.error(n,r);return u.transport=t?t.name:i,u},format:function(){for(var t=arguments[0],n=0;n<\/script>.");}};e.load(function(){s=!0});r.fn=r.prototype={init:function(t,i,r){var f=n(this);this.url=t;this.qs=i;this._={connectingMessageBuffer:new k(this,function(n){f.triggerHandler(u.onReceived,[n])}),onFailedTimeoutHandle:null};typeof r=="boolean"&&(this.logging=r)},_parseResponse:function(n){var t=this;return n?t.ajaxDataType==="text"?t.json.parse(n):n:n},json:t.JSON,isCrossDomain:function(i,r){var u;return(i=n.trim(i),i.indexOf("http")!==0)?!1:(r=r||t.location,u=t.document.createElement("a"),u.href=i,u.protocol+l(u.protocol,u.host)!==r.protocol+l(r.protocol,r.host))},ajaxDataType:"text",contentType:"application/json; charset=UTF-8",logging:!1,state:r.connectionState.disconnected,keepAliveData:{},clientProtocol:"1.3",reconnectDelay:2e3,transportConnectTimeout:0,disconnectTimeout:3e4,keepAliveWarnAt:2/3,start:function(i,h){var l=this,a={pingInterval:3e5,waitForPageLoad:!0,transport:"auto",jsonp:!1},d,v=l._deferral||n.Deferred(),b=t.document.createElement("a"),k,g;if(l._deferral=v,!l.json)throw new Error("SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.");if(n.type(i)==="function"?h=i:n.type(i)==="object"&&(n.extend(a,i),n.type(a.callback)==="function"&&(h=a.callback)),a.transport=w(a.transport,l),!a.transport)throw new Error("SignalR: Invalid transport(s) specified, aborting start.");return(l._.config=a,!s&&a.waitForPageLoad===!0)?(l._.deferredStartHandler=function(){l.start(i,h)},e.bind("load",l._.deferredStartHandler),v.promise()):l.state===r.connectionState.connecting?v.promise():o(l,r.connectionState.disconnected,r.connectionState.connecting)===!1?(v.resolve(l),v.promise()):(p(l),b.href=l.url,b.protocol&&b.protocol!==":"?(l.protocol=b.protocol,l.host=b.host,l.baseUrl=b.protocol+"//"+b.host):(l.protocol=t.document.location.protocol,l.host=t.document.location.host,l.baseUrl=l.protocol+"//"+l.host),l.wsProtocol=l.protocol==="https:"?"wss://":"ws://",a.transport==="auto"&&a.jsonp===!0&&(a.transport="longPolling"),this.isCrossDomain(l.url)&&(l.log("Auto detected cross domain url."),a.transport==="auto"&&(a.transport=["webSockets","longPolling"]),typeof a.withCredentials=="undefined"&&(a.withCredentials=!0),a.jsonp||(a.jsonp=!n.support.cors,a.jsonp&&l.log("Using jsonp because this browser doesn't support CORS.")),l.contentType=r._.defaultContentType),l.withCredentials=a.withCredentials,l.ajaxDataType=a.jsonp?"jsonp":"text",n(l).bind(u.onStart,function(){n.type(h)==="function"&&h.call(l);v.resolve(l)}),d=function(i,s){var w=r._.error(f.noTransportOnInit);if(s=s||0,s>=i.length){n(l).triggerHandler(u.onError,[w]);v.reject(w);l.stop();return}if(l.state!==r.connectionState.disconnected){var c=i[s],h=n.type(c)==="object"?c:r.transports[c],a=!1,p=function(){a||(a=!0,t.clearTimeout(l._.onFailedTimeoutHandle),h.stop(l),d(i,s+1))};if(l.transport=h,c.indexOf("_")===0){d(i,s+1);return}try{l._.onFailedTimeoutHandle=t.setTimeout(function(){l.log(h.name+" timed out when trying to connect.");p()},l.transportConnectTimeout);h.start(l,function(){var i=r._.firefoxMajorVersion(t.navigator.userAgent)>=11,f=!!l.withCredentials&&i;l.state!==r.connectionState.disconnected&&(a||(a=!0,t.clearTimeout(l._.onFailedTimeoutHandle),h.supportsKeepAlive&&l.keepAliveData.activated&&r.transports._logic.monitorKeepAlive(l),y(l),o(l,r.connectionState.connecting,r.connectionState.connected),l._.connectingMessageBuffer.drain(),n(l).triggerHandler(u.onStart),e.bind("unload",function(){l.log("Window unloading, stopping the connection.");l.stop(f)}),i&&e.bind("beforeunload",function(){t.setTimeout(function(){l.stop(f)},0)})))},p)}catch(b){l.log(h.name+" transport threw '"+b.message+"' when attempting to start.");p()}}},k=l.url+"/negotiate",g=function(t,i){var e=r._.error(f.errorOnNegotiate,t);n(i).triggerHandler(u.onError,e);v.reject(e);i.stop()},n(l).triggerHandler(u.onStarting),k=r.transports._logic.prepareQueryString(l,k),k=r.transports._logic.addQs(k,{clientProtocol:l.clientProtocol}),l.log("Negotiating with '"+k+"'."),l._.negotiateRequest=n.ajax(n.extend({},n.signalR.ajaxDefaults,{xhrFields:{withCredentials:l.withCredentials},url:k,type:"GET",contentType:l.contentType,data:{},dataType:l.ajaxDataType,error:function(n,t){t!==c?g(n,l):v.reject(r._.error(f.stoppedWhileNegotiating))},success:function(t){var i,e,h,o=[],s=[];try{i=l._parseResponse(t)}catch(c){g(r._.error(f.errorParsingNegotiateResponse,c),l);return}if(e=l.keepAliveData,l.appRelativeUrl=i.Url,l.id=i.ConnectionId,l.token=i.ConnectionToken,l.webSocketServerUrl=i.WebSocketServerUrl,l.disconnectTimeout=i.DisconnectTimeout*1e3,l.transportConnectTimeout=l.transportConnectTimeout+i.TransportConnectTimeout*1e3,i.KeepAliveTimeout?(e.activated=!0,e.timeout=i.KeepAliveTimeout*1e3,e.timeoutWarning=e.timeout*l.keepAliveWarnAt,e.checkInterval=(e.timeout-e.timeoutWarning)/3):e.activated=!1,!i.ProtocolVersion||i.ProtocolVersion!==l.clientProtocol){h=r._.error(r._.format(f.protocolIncompatible,l.clientProtocol,i.ProtocolVersion));n(l).triggerHandler(u.onError,[h]);v.reject(h);return}n.each(r.transports,function(n){if(n==="webSockets"&&!i.TryWebSockets)return!0;s.push(n)});n.isArray(a.transport)?n.each(a.transport,function(){var t=this;(n.type(t)==="object"||n.type(t)==="string"&&n.inArray(""+t,s)>=0)&&o.push(n.type(t)==="string"?""+t:t)}):n.type(a.transport)==="object"||n.inArray(a.transport,s)>=0?o.push(a.transport):o=s;d(o)}})),v.promise())},starting:function(t){var i=this;return n(i).bind(u.onStarting,function(){t.call(i)}),i},send:function(n){var t=this;if(t.state===r.connectionState.disconnected)throw new Error("SignalR: Connection must be started before data can be sent. Call .start() before .send()");if(t.state===r.connectionState.connecting)throw new Error("SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started.");return t.transport.send(t,n),t},received:function(t){var i=this;return n(i).bind(u.onReceived,function(n,r){i._.connectingMessageBuffer.tryBuffer(r)||t.call(i,r)}),i},stateChanged:function(t){var i=this;return n(i).bind(u.onStateChanged,function(n,r){t.call(i,r)}),i},error:function(t){var i=this;return n(i).bind(u.onError,function(n,r){t.call(i,r)}),i},disconnected:function(t){var i=this;return n(i).bind(u.onDisconnect,function(){t.call(i)}),i},connectionSlow:function(t){var i=this;return n(i).bind(u.onConnectionSlow,function(){t.call(i)}),i},reconnecting:function(t){var i=this;return n(i).bind(u.onReconnecting,function(){t.call(i)}),i},reconnected:function(t){var i=this;return n(i).bind(u.onReconnect,function(){t.call(i)}),i},stop:function(i,h){var l=this,a=l._deferral;if(l._.deferredStartHandler&&e.unbind("load",l._.deferredStartHandler),delete l._deferral,delete l._.config,delete l._.deferredStartHandler,!s&&(!l._.config||l._.config.waitForPageLoad===!0)){l.log("Stopping connection prior to negotiate.");a&&a.reject(r._.error(f.stoppedWhileLoading));return}if(l.state!==r.connectionState.disconnected){try{l.log("Stopping connection.");t.clearTimeout(l._.onFailedTimeoutHandle);t.clearInterval(l._.pingIntervalId);l.transport&&(h!==!1&&l.transport.abort(l,i),l.transport.supportsKeepAlive&&l.keepAliveData.activated&&r.transports._logic.stopMonitoringKeepAlive(l),l.transport.stop(l),l.transport=null);l._.negotiateRequest&&(l._.negotiateRequest.abort(c),delete l._.negotiateRequest);n(l).triggerHandler(u.onDisconnect);delete l.messageId;delete l.groupsToken;delete l.id;delete l._.pingIntervalId;l._.connectingMessageBuffer.clear()}finally{o(l,l.state,r.connectionState.disconnected)}return l}},log:function(n){a(n,this.logging)}};r.fn.init.prototype=r.fn;r.noConflict=function(){return n.connection===r&&(n.connection=h),r};n.connection&&(h=n.connection);n.connection=n.signalR=r})(window.jQuery,window),function(n,t){"use strict";function f(u){var e=u.keepAliveData,o,s;u.state===i.connectionState.connected&&(o=new Date,o.setTime(o-e.lastKeepAlive),s=o.getTime(),s>=e.timeout?(u.log("Keep alive timed out. Notifying transport that connection has been lost."),u.transport.lostConnection(u)):s>=e.timeoutWarning?e.userNotified||(u.log("Keep alive has been missed, connection may be dead/slow."),n(u).triggerHandler(r.onConnectionSlow),e.userNotified=!0):e.userNotified=!1);e.monitoring&&t.setTimeout(function(){f(u)},e.checkInterval)}function o(n){return n.state===i.connectionState.connected||n.state===i.connectionState.reconnecting}function s(n,i){var r=n.indexOf("?")!==-1?"&":"?";return i&&(n+=r+"connectionData="+t.encodeURIComponent(i)),n}var i=n.signalR,r=n.signalR.events,e=n.signalR.changeState,u;i.transports={};u=i.transports._logic={pingServer:function(t){var e,f,r=n.Deferred();return t.transport?(e=t.transport.name==="webSockets"?"":t.baseUrl,f=e+t.appRelativeUrl+"/ping",f=u.prepareQueryString(t,f),n.ajax(n.extend({},n.signalR.ajaxDefaults,{xhrFields:{withCredentials:t.withCredentials},url:f,type:"GET",contentType:t.contentType,data:{},dataType:t.ajaxDataType,success:function(n){var u;try{u=t._parseResponse(n)}catch(f){r.reject(i._.transportError(i.resources.pingServerFailedParse,t.transport,f));t.stop();return}u.Response==="pong"?r.resolve():r.reject(i._.transportError(i._.format(i.resources.pingServerFailedInvalidResponse,n.responseText),t.transport))},error:function(n){n.status===401||n.status===403?(r.reject(i._.transportError(i._.format(i.resources.pingServerFailedStatusCode,n.status),t.transport,n)),t.stop()):r.reject(i._.transportError(i.resources.pingServerFailed,t.transport,n))}}))):r.reject(i._.transportError(i.resources.noConnectionTransport,t.transport)),r.promise()},prepareQueryString:function(n,t){return t=u.addQs(t,n.qs),s(t,n.data)},addQs:function(t,i){var r=t.indexOf("?")!==-1?"&":"?",u;if(!i)return t;if(typeof i=="object")return t+r+n.param(i);if(typeof i=="string")return u=i.charAt(0),(u==="?"||u==="&")&&(r=""),t+r+i;throw new Error("Query string property must be either a string or object.");},getUrl:function(n,i,r,f){var s=i==="webSockets"?"":n.baseUrl,e=s+n.appRelativeUrl,o="transport="+i+"&connectionToken="+t.encodeURIComponent(n.token);return n.groupsToken&&(o+="&groupsToken="+t.encodeURIComponent(n.groupsToken)),r?(e+=f?"/poll":"/reconnect",n.messageId&&(o+="&messageId="+t.encodeURIComponent(n.messageId))):e+="/connect",e+="?"+o,e=u.prepareQueryString(n,e),e+("&tid="+Math.floor(Math.random()*11))},maximizePersistentResponse:function(n){return{MessageId:n.C,Messages:n.M,Initialized:typeof n.S!="undefined"?!0:!1,Disconnect:typeof n.D!="undefined"?!0:!1,ShouldReconnect:typeof n.T!="undefined"?!0:!1,LongPollDelay:n.L,GroupsToken:n.G}},updateGroups:function(n,t){t&&(n.groupsToken=t)},stringifySend:function(n,t){return typeof t=="string"||typeof t=="undefined"||t===null?t:n.json.stringify(t)},ajaxSend:function(f,e){var h=u.stringifySend(f,e),o=f.url+"/send?transport="+f.transport.name+"&connectionToken="+t.encodeURIComponent(f.token),s=function(t,u){n(u).triggerHandler(r.onError,[i._.transportError(i.resources.sendFailed,u.transport,t),e])};return o=u.prepareQueryString(f,o),n.ajax(n.extend({},n.signalR.ajaxDefaults,{xhrFields:{withCredentials:f.withCredentials},url:o,type:f.ajaxDataType==="jsonp"?"GET":"POST",contentType:i._.defaultContentType,dataType:f.ajaxDataType,data:{data:h},success:function(t){var i;if(t){try{i=f._parseResponse(t)}catch(u){s(u,f);f.stop();return}n(f).triggerHandler(r.onReceived,[i])}},error:function(n,t){t!=="abort"&&t!=="parsererror"&&s(n,f)}}))},ajaxAbort:function(i,r){if(typeof i.transport!="undefined"){r=typeof r=="undefined"?!0:r;var f=i.url+"/abort?transport="+i.transport.name+"&connectionToken="+t.encodeURIComponent(i.token);f=u.prepareQueryString(i,f);n.ajax(n.extend({},n.signalR.ajaxDefaults,{xhrFields:{withCredentials:i.withCredentials},url:f,async:r,timeout:1e3,type:"POST",contentType:i.contentType,dataType:i.ajaxDataType,data:{}}));i.log("Fired ajax abort async = "+r+".")}},tryInitialize:function(n,t){n.Initialized&&t()},processMessages:function(t,i,f){var e,o=n(t);if(t.transport&&t.transport.supportsKeepAlive&&t.keepAliveData.activated&&this.updateKeepAlive(t),i){if(e=this.maximizePersistentResponse(i),e.Disconnect){t.log("Disconnect command received from server.");t.stop(!1,!1);return}this.updateGroups(t,e.GroupsToken);e.MessageId&&(t.messageId=e.MessageId);e.Messages&&(n.each(e.Messages,function(n,t){o.triggerHandler(r.onReceived,[t])}),u.tryInitialize(e,f))}},monitorKeepAlive:function(t){var i=t.keepAliveData,u=this;i.monitoring?t.log("Tried to monitor keep alive but it's already being monitored."):(i.monitoring=!0,u.updateKeepAlive(t),t.keepAliveData.reconnectKeepAliveUpdate=function(){u.updateKeepAlive(t)},n(t).bind(r.onReconnect,t.keepAliveData.reconnectKeepAliveUpdate),t.log("Now monitoring keep alive with a warning timeout of "+i.timeoutWarning+" and a connection lost timeout of "+i.timeout+"."),f(t))},stopMonitoringKeepAlive:function(t){var i=t.keepAliveData;i.monitoring&&(i.monitoring=!1,n(t).unbind(r.onReconnect,t.keepAliveData.reconnectKeepAliveUpdate),t.keepAliveData={},t.log("Stopping the monitoring of the keep alive."))},updateKeepAlive:function(n){n.keepAliveData.lastKeepAlive=new Date},ensureReconnectingState:function(t){return e(t,i.connectionState.connected,i.connectionState.reconnecting)===!0&&n(t).triggerHandler(r.onReconnecting),t.state===i.connectionState.reconnecting},clearReconnectTimeout:function(n){n&&n._.reconnectTimeout&&(t.clearTimeout(n._.reconnectTimeout),delete n._.reconnectTimeout)},reconnect:function(n,r){var u=i.transports[r],f=this;o(n)&&!n._.reconnectTimeout&&(n._.reconnectTimeout=t.setTimeout(function(){u.stop(n);f.ensureReconnectingState(n)&&(n.log(r+" reconnecting."),u.start(n))},n.reconnectDelay))},handleParseFailure:function(t,u,f,e){t.state===i.connectionState.connecting?(t.log("Failed to parse server response while attempting to connect."),e()):(n(t).triggerHandler(r.onError,[i._.transportError(i._.format(i.resources.parseFailed,u),t.transport,f)]),t.stop())},foreverFrame:{count:0,connections:{}}}}(window.jQuery,window),function(n,t){"use strict";var r=n.signalR,u=n.signalR.events,f=n.signalR.changeState,i=r.transports._logic;r.transports.webSockets={name:"webSockets",supportsKeepAlive:!0,send:function(n,t){var r=i.stringifySend(n,t);n.socket.send(r)},start:function(e,o,s){var h,c=!1,l=this,a=!o,v=n(e);if(!t.WebSocket){s();return}e.socket||(h=e.webSocketServerUrl?e.webSocketServerUrl:e.wsProtocol+e.host,h+=i.getUrl(e,this.name,a),e.log("Connecting to websocket endpoint '"+h+"'."),e.socket=new t.WebSocket(h),e.socket.onopen=function(){c=!0;e.log("Websocket opened.");i.clearReconnectTimeout(e);f(e,r.connectionState.reconnecting,r.connectionState.connected)===!0&&v.triggerHandler(u.onReconnect)},e.socket.onclose=function(t){if(this===e.socket){if(c)typeof t.wasClean!="undefined"&&t.wasClean===!1?(n(e).triggerHandler(u.onError,[r._.transportError(r.resources.webSocketClosed,e.transport,t)]),e.log("Unclean disconnect from websocket: "+t.reason||"[no reason given].")):e.log("Websocket closed.");else{s?s():a&&l.reconnect(e);return}l.reconnect(e)}},e.socket.onmessage=function(t){var r,f=n(e);try{r=e._parseResponse(t.data)}catch(h){i.handleParseFailure(e,t.data,h,s);return}r&&(n.isEmptyObject(r)||r.M?i.processMessages(e,r,o):f.triggerHandler(u.onReceived,[r]))})},reconnect:function(n){i.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},stop:function(n){i.clearReconnectTimeout(n);n.socket&&(n.log("Closing the Websocket."),n.socket.close(),n.socket=null)},abort:function(n,t){i.ajaxAbort(n,t)}}}(window.jQuery,window),function(n,t){"use strict";var i=n.signalR,u=n.signalR.events,f=n.signalR.changeState,r=i.transports._logic;i.transports.serverSentEvents={name:"serverSentEvents",supportsKeepAlive:!0,timeOut:3e3,start:function(e,o,s){var h=this,c=!1,l=n(e),a=!o,v,y;if(e.eventSource&&(e.log("The connection already has an event source. Stopping it."),e.stop()),!t.EventSource){s&&(e.log("This browser doesn't support SSE."),s());return}v=r.getUrl(e,this.name,a);try{e.log("Attempting to connect to SSE endpoint '"+v+"'.");e.eventSource=new t.EventSource(v)}catch(p){e.log("EventSource failed trying to connect with error "+p.Message+".");s?s():(l.triggerHandler(u.onError,[i._.transportError(i.resources.eventSourceFailedToConnect,e.transport,p)]),a&&h.reconnect(e));return}a&&(y=t.setTimeout(function(){c===!1&&e.eventSource.readyState!==t.EventSource.OPEN&&h.reconnect(e)},h.timeOut));e.eventSource.addEventListener("open",function(){e.log("EventSource connected.");y&&t.clearTimeout(y);r.clearReconnectTimeout(e);c===!1&&(c=!0,f(e,i.connectionState.reconnecting,i.connectionState.connected)===!0&&l.triggerHandler(u.onReconnect))},!1);e.eventSource.addEventListener("message",function(n){var t;if(n.data!=="initialized"){try{t=e._parseResponse(n.data)}catch(i){r.handleParseFailure(e,n.data,i,s);return}r.processMessages(e,t,o)}},!1);e.eventSource.addEventListener("error",function(n){if(this===e.eventSource){if(!c){s&&s();return}e.log("EventSource readyState: "+e.eventSource.readyState+".");n.eventPhase===t.EventSource.CLOSED?(e.log("EventSource reconnecting due to the server connection ending."),h.reconnect(e)):(e.log("EventSource error."),l.triggerHandler(u.onError,[i._.transportError(i.resources.eventSourceError,e.transport,n)]))}},!1)},reconnect:function(n){r.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},send:function(n,t){r.ajaxSend(n,t)},stop:function(n){r.clearReconnectTimeout(n);n&&n.eventSource&&(n.log("EventSource calling close()."),n.eventSource.close(),n.eventSource=null,delete n.eventSource)},abort:function(n,t){r.ajaxAbort(n,t)}}}(window.jQuery,window),function(n,t){"use strict";var r=n.signalR,f=n.signalR.events,e=n.signalR.changeState,i=r.transports._logic,u=function(){var u=null,f=1e3,i=0;return{prevent:function(){r._.ieVersion<=8&&(i===0&&(u=t.setInterval(function(){var t=n("