Renaming RpcConnection to HubConnection
This commit is contained in:
parent
4158dfed8f
commit
e6b34fdce3
|
|
@ -31,6 +31,7 @@ runtimes/
|
|||
.testPublish/
|
||||
launchSettings.json
|
||||
node_modules/
|
||||
npm-debug.log
|
||||
*.tmp
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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>();
|
||||
|
|
@ -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'));
|
||||
|
|
|
|||
Loading…
Reference in New Issue