Renaming RpcConnection to HubConnection

This commit is contained in:
moozzyk 2016-11-29 16:03:56 -08:00
parent 4158dfed8f
commit e6b34fdce3
5 changed files with 7 additions and 6 deletions

1
.gitignore vendored
View File

@ -31,6 +31,7 @@ runtimes/
.testPublish/
launchSettings.json
node_modules/
npm-debug.log
*.tmp
*.nuget.props
*.nuget.targets

View File

@ -14,7 +14,7 @@
</div>
<script src="lib/signalr-client/signalr-client.js"></script>
<script>
let connection = new signalR.RpcConnection(`http://${document.location.host}/chat`, 'formatType=json&format=text');
let connection = new signalR.HubConnection(`http://${document.location.host}/chat`, 'formatType=json&format=text');
connection.on('Send', function (message) {
var child = document.createElement('li');

View File

@ -108,7 +108,7 @@ let transport = getParameterByName('transport') || 'webSockets';
document.getElementById('head1').innerHTML = transport;
let connection = new signalR.RpcConnection(`http://${document.location.host}/hubs`, 'formatType=json&format=text');
let connection = new signalR.HubConnection(`http://${document.location.host}/hubs`, 'formatType=json&format=text');
connection.on('Send', msg => {
addLine(msg);
});

View File

@ -12,7 +12,7 @@ interface InvocationResultDescriptor {
readonly Result: any;
}
export class RpcConnection {
export class HubConnection {
private connection: Connection;
private callbacks: Map<string, (any) => void>;
private methods: Map<string, (...args:any[]) => void>;
@ -21,9 +21,9 @@ export class RpcConnection {
constructor(url: string, queryString?: string) {
this.connection = new Connection(url, queryString);
let thisRpcConnection = this;
let thisHubConnection = this;
this.connection.dataReceived = data => {
thisRpcConnection.dataReceived(data);
thisHubConnection.dataReceived(data);
};
this.callbacks = new Map<string, (any) => void>();

View File

@ -19,7 +19,7 @@ gulp.task('compile-ts-client', () => {
});
gulp.task('browserify-client', ['compile-ts-client'], () => {
return browserify(clientOutDir + '/RpcConnection.js', {standalone: 'signalR'})
return browserify(clientOutDir + '/HubConnection.js', {standalone: 'signalR'})
.bundle()
.pipe(source('signalr-client.js'))
.pipe(gulp.dest(clientOutDir + '/../signalr-client-bundle'));