I m using SignalR-ObjC Client to provide communication between my IOS application and .Net server.
I can connect with longpulling and invoke methods from self-host cross domain server without any error. But because of my applications needs i have to use WebSocket. I have a Singleton Manager like :
@implementation SignalRManager
static int reconnectingTry;
+ (id)sharedManager {
static SignalRManager *sharedHttpManager = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedHttpManager = [[self alloc] init];
sharedHttpManager.hubConnection = [SRHubConnection connectionWithURL:@"http://xxx:8080/signalr"];
sharedHttpManager.proxy = [sharedHttpManager.hubConnection createHubProxy:@"myhub"];
});
return sharedHttpManager;
}
+(SRHubProxy *)proxy
{
return [[SignalRManager sharedManager] proxy];
}
+(SRHubConnection *)connection
{
return [[SignalRManager sharedManager] hubConnection];
}
+(void)start
{
SRWebSocketTransport *transport = [[SRWebSocketTransport alloc] init];
[[SignalRManager connection] start:transport];
}
+(void)stop
{
[[SignalRManager connection] stop];
}
and i m invoking like :
[[SignalRManager proxy] invoke:@"Hello" withArgs:[NSArray array]];
i establish connection and server can invoke client method but when i try invoke method from client to server the "Request failed:bad request(400)" error occur.