Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SignalR-ObjC error seek help #294

Open
rainLiuSkypine opened this issue Sep 28, 2017 · 2 comments
Open

SignalR-ObjC error seek help #294

rainLiuSkypine opened this issue Sep 28, 2017 · 2 comments

Comments

@rainLiuSkypine
Copy link

This is my code:
SRHubConnection *hubConnection = [[SRHubConnection alloc] initWithURLString:URL_BASIC useDefault:NO];
hubConnection.delegate = self;

id par = @{@"X-ZUMO-AUTH":[SkUserDefaults readUser].AuthenticationToken};
hubConnection.headers = par;
 _chat = (id)[hubConnection createHubProxy:@"CarGpsHub"];
 [_chat on:@"GpsSite" perform:self selector:@selector(responseMessage:)];
[hubConnection setStarted:^{
    NSLog(@"Connection Started");
}];
[hubConnection setReceived:^(NSString *message) {
    NSLog(@"Connection Recieved Data: %@",message);
}];
[hubConnection setConnectionSlow:^{
    NSLog(@"Connection Slow");
}];
[hubConnection setReconnecting:^{
    NSLog(@"Connection Reconnecting");
}];
[hubConnection setClosed:^{
    NSLog(@"Connection Closed");
}];
[hubConnection setError:^(NSError *error) {
    NSLog(@"Connection Error %@",error);
}];

[hubConnection start];

NSArray *arr = [NSArray arrayWithObject:[SkUserDefaults readCar].DeviceId];
[_chat invoke:@"GpsSite" withArgs:arr completionHandler:nil];

this is server code :
public class CarGpsHub : Hub
{
//[Microsoft.AspNet.SignalR.Authorize]
public void GpsSite(string deviceId)
{

        Clients.Client(this.Context.ConnectionId).GpsSite("连接成功!");
               }

}

but it is receive an error
connection did receive error Error Domain=com.SignalR.SignalR-ObjC.SRHubConnection Code=0 "The connection has not been established" UserInfo={NSLocalizedFailureReason=NSInternalInconsistencyException, NSLocalizedDescription=The connection has not been established}
TRANSPORT: negotiate was successful {
ConnectionId = "6452610a-f649-4b62-91de-cb606f24ac60";
ConnectionTimeout = 18;
ConnectionToken = "5sA+r8urGQRsOd8ZABqFBekMOa+jqNWQJDC+4Hrln/izW7yAL0C4K6gT2cwHXMP/39h/DOpeJJ/HDmxtrIF2iO5+OSFtbCMr+dJAwzlq0lwVkmdV43CWUv8BpZ0pXbbV";
DisconnectTimeout = 6;
KeepAliveTimeout = 4;
LongPollDelay = 0;
ProtocolVersion = "1.3.0.0";
TransportConnectTimeout = 5;
TryWebSockets = 1;
Url = "/signalr";
}
can you give me some advice?

@SSDABSiddique
Copy link

I am also facing same message. "connection did receive error Error Domain=com.SignalR.SignalR-ObjC.SRHubConnection Code=0 "The connection has not been established" UserInfo={NSLocalizedFailureReason=NSInternalInconsistencyException, NSLocalizedDescription=The connection has not been established}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@rainLiuSkypine @SSDABSiddique and others