无法从iOS中的信号服务器接收数据
嗨,我是信号集成的新手。信号器连接已成功启动,但有时我能够接收数据,而有时我无法从服务器接收数据(未调用connection.received方法)。请检查下面我使用的代码,并给出您的建议无法从iOS中的信号服务器接收数据,ios,objective-c,signalr,Ios,Objective C,Signalr,嗨,我是信号集成的新手。信号器连接已成功启动,但有时我能够接收数据,而有时我无法从服务器接收数据(未调用connection.received方法)。请检查下面我使用的代码,并给出您的建议 SRHubConnection *connection = [SRHubConnection connectionWithURL:@"http://strandd-dev.azure-mobile.net/signalr"]; //connection.delegate = self; [connectio
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(@"------------");
}
它在浪费我的时间,请帮助我。看到这个链接可能会帮助你@GouthamI我也面临同样的问题,你能帮我一下吗。