无法从iOS中的SignalR Server接收数据

您好,我是SignalR Integration的新手。 SignalR连接启动成功,但有时我正在接收数据,有些时候我无法从服务器接收数据(connection.received方法没有被调用)。 请检查我使用的代码,并给出你的build议。

SRHubConnection *connection = [SRHubConnection connectionWithURL:@"http://strandd-dev.azure-mobile.net/signalr"]; //connection.delegate = self; [connection addValue:token forHTTPHeaderField:@"X-ZUMO-AUTH"]; [connection addValue:@"Basic TElWRTpKRHVrZnFGZmZNcXV3bVlnYm9Wd05ibWRoVEZuemY4" forHTTPHeaderField:@"Authorization"]; //TElWRTpKRHVrZnFGZmZNcXV3bVlnYm9Wd05ibWRoVEZuemY4 //REVWOnZPdGZOVHBnYlNxZ3RtZFZ2VENLVGVYTkxvek9CeDE2 myHub = [connection createHubProxy:@"IncidentHub"]; NSLog(@"Goutham"); connection.error = ^(NSError *error) { NSLog(@"error ====%@",error); }; connection.started = ^{ NSLog(@"Connection Started"); [myHub invoke:@"GetMobileCustomerClientIncidentStatusRequest" withArgs:[NSArray arrayWithObjects:incidentGUID, nil]]; [self.delegate signalrConnectionDidStarted]; }; connection.received = ^(NSString * data) { NSLog(@"data ====%@",data); [self.delegate didReceivedDataFromSignalR:data]; }; @try { [connection start]; } @catch (NSException *exception) { NSLog(@"exception ----%@",exception); } @finally { NSLog(@"------------"); } 

它杀了我的时间,请帮助我。