我在客户端的SignalRService类中有两个方法:
for file in $Data
do
echo "No white space [$file]"
ls -l "$file"
done
初始化在构造函数中进行,如下所示:
public startConnection(): void {
this.connection.start().done((data: any) => {
console.log('Now connected ' + data.transport.name + ', connection
ID= ' + data.id);
//this.connectionEstablished.emit(true);
this.connectionExists = true;
}).fail((error: any) => {
console.log('Could not connect ' + error);
//this.connectionEstablished.emit(false);
});
}
public stopConnection():void {
this.connection.stop();
console.log('Stop connection');
}
我需要在停止后再次调用start但它失败但异常:
this.connection = $.hubConnection(environment.apiUrl);
this.connection.qs = "Bearer="+this._authService.getToken();
// create new proxy as name already given in top
this.proxy = this.connection.createHubProxy(this.proxyName);
请帮帮我吧!