Tag: signalr

无法从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); […]

SignalR .Net客户端失败,设备上出现500个服务器错误,在模拟器上正常工作

我试图在我的应用程序中实现聊天,在后端使用azure asp.net web api,在前端使用xamarin ios。 所以在后端我用这几行configuration我的集线器: var hubConfiguration = new HubConfiguration(); hubConfiguration.EnableDetailedErrors = true; app.MapSignalR("/signalr", hubConfiguration); 这是我的中心来源: [HubName("Chat")] public class Chat : Hub { public Task JoinRoom(string roomName) { return Groups.Add(Context.ConnectionId, roomName); } public Task LeaveRoom(string roomName) { return Groups.Remove(Context.ConnectionId, roomName); } public Task Send(string message, string room) { return Clients.OthersInGroup(room).addMessage(message); } } 在Xamarin ios客户端上,一切都非常简单: […]