-2

I am totally new to ios developement/siganlr. what i'm trying to do is connect signalr-objc client to get long-polling feed from .net api.

It work fine on javascript:

var connection = $.hubConnection();
connection.url = "http://HOST:8080/live";
connection.qs = { 'group': 'default' };
connection.start({ transport: ['longPolling'] }).done(function() {
    console.log('Proxy Started');
});
var myHubProxy = connection.createHubProxy('quotesHub');
myHubProxy.on('update',callback);

pod file: platform :ios, '6.0' pod 'AFNetworking' pod 'SignalR-ObjC', '2.0.0.alpha1'

SRHubProxy *myHub

- (void)viewDidLoad {
    [super viewDidLoad];
    SRHubConnection *hubConnection = [SRHubConnection           connectionWithURL:@"http://HOST:8080/live"];
    myHub = [hubConnection createHubProxy:@"quotesHub"];
    [hubConnection start];
}

Console: 2015-02-16 10:02:27.070 BOP[7575:201923] Thread {number = 1, name = main}:-[SRHubConnection createHubProxy:] [Line 90] [CONNECTION] will create proxy quotesHub 2015-02-16 10:02:27.071 BOP[7575:201923] Thread {number = 1, name = main}:-[SRConnection negotiate:] [Line 145] [CONNECTION] will negotiate 2015-02-16 10:02:27.231 BOP[7575:201923] Thread {number = 1, name = main}:__26-[SRConnection negotiate:]_block_invoke [Line 153] [CONNECTION] negotiation was successful NegotiationResponse: ConnectionId=3f45c0e5-4d82-4fc6-b93c-899df9fa4d8d ConnectionToken=AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAj7aAvp83K0eLymig4Ji2AQAAAAACAAAAAAAQZgAAAAEAACAAAADDOcCsrRYY6DlcehbqrENsZS8oS0al5bS5+iB4kfxAxAAAAAAOgAAAAAIAACAAAADX5hJioXnlSWFAeB372DRI+KmNIhKHu0tAZQJv74F5IDAAAABJ8+6Xcn9nhSM0uR8OVEP3cRgCaGBBxH1PwVbmIKuAN8SCJSYzvuWxY2CApjh54/xAAAAAgp7E/TFp1LzCBg366o3o53Pm/hKpd+s8CrlqF/6DJ+kSIM817FImrLk1nPBI97NH1vg+TiGjReGRojCmARUGiw== Url=/live/signalr/signalr ProtocolVersion=1.3.0.0 TryWebSockets=1 2015-02-16 10:02:27.365 BOP[7575:201923] Thread {number = 1, name = main}:__64-[SRLongPollingTransport poll:connectionData:completionHandler:]_block_invoke [Line 115] [LONG_POLLING] LP Receive: {"C":"d-F194B7D3-ESt,0|ESu,22|ESv,1|ESw,0|ESx,0","G":"AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAj7aAvp83K0eLymig4Ji2AQAAAAACAAAAAAAQZgAAAAEAACAAAADWWDNmvsVMU7xiw3MUzup31k5foUMePnHxGFNk1iYniQAAAAAOgAAAAAIAACAAAACvRs4amrWeEHvEhvruL56d7WU3fcV6/Lkn2LrMvBehiEAAAACPONM/LfXd9oIuoGyRGST2aPB84UKlLdQU7Bf7ElX4ejaj+i2e105JnxOHys7Ft1NIYrALCIi5kACQeWNCUW8WQAAAAINXqlHul+DNuDfj5VFm/UV9OPyRpElfFkBh59gIt0paKvg4DaGiq5j+WWzEooDMf9Vn7ubPbAdnRCBMslr/BdI=","M":[{"H":"QuotesHub","M":"Update","A":[{"Time":1423857599,"Symbol":"SKC:AGI","Bid":163.5,"Ask":164.25}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062933,"Symbol":"SWCO:AGI","Bid":53.37,"Ask":53.48}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062927,"Symbol":"SBCO:AGI","Bid":61.27,"Ask":61.38}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062946,"Symbol":"HSI:AGI","Bid":24697.0,"Ask":24707.0}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062841,"Symbol":"KOSPI:AGI","Bid":250.63,"Ask":250.73}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062744,"Symbol":"NIKK:AGI","Bid":18021.0,"Ask":18031.0}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062943,"Symbol":"USDCHF_b","Bid":0.92932,"Ask":0.92938}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062935,"Symbol":"GBPUSD_b","Bid":1.54214,"Ask":1.5422}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062934,"Symbol":"EURUSD_b","Bid":1.14146,"Ask":1.14152}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062941,"Symbol":"USDJPY_b","Bid":118.593,"Ask":118.599}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062937,"Symbol":"NZDUSD_b","Bid":0.75009,"Ask":0.75015}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062941,"Symbol":"AUDUSD_b","Bid":0.77845,"Ask":0.77851}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062893,"Symbol":"USDCAD_b","Bid":1.24344,"Ask":1.2435}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062921,"Symbol":"EURGBP_b","Bid":0.74015,"Ask":0.74021}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062947,"Symbol":"EURJPY_b","Bid":135.37,"Ask":135.376}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062941,"Symbol":"GBPJPY_b","Bid":182.888,"Ask":182.894}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062936,"Symbol":"CHFJPY_b","Bid":127.612,"Ask":127.618}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062936,"Symbol":"EURCHF_b","Bid":1.06083,"Ask":1.06089}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062936,"Symbol":"AUDJPY_b","Bid":92.321,"Ask":92.329}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062943,"Symbol":"GBPCHF_b","Bid":1.43317,"Ask":1.43324}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062893,"Symbol":"GBPCAD_b","Bid":1.91766,"Ask":1.91774}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062927,"Symbol":"GBPAUD_b","Bid":1.98093,"Ask":1.98098}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062944,"Symbol":"USDCNH_b","Bid":6.25113,"Ask":6.25118}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062937,"Symbol":"XAUUSD_b","Bid":1233.25,"Ask":1233.85}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424052003,"Symbol":"XAUEUR_b","Bid":1077.9,"Ask":1078.4}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062927,"Symbol":"XAGUSD_b","Bid":17.35,"Ask":17.41}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1423871880,"Symbol":"XAGEUR_b","Bid":15.22,"Ask":15.27}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1423868402,"Symbol":"NDX","Bid":4383.99,"Ask":4384.08}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062919,"Symbol":"NQH","Bid":4375.59,"Ask":4375.68}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1424062919,"Symbol":"NQM","Bid":4370.71,"Ask":4370.8}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1423673496,"Symbol":"NQU","Bid":4272.21,"Ask":4272.3}]},{"H":"QuotesHub","M":"Update","A":[{"Time":1423672098,"Symbol":"NQZ","Bid":4260.21,"Ask":4260.3}]},{"H":"QuotesHub","M":"Update","A":[{"Time":0,"Symbol":"FTSE","Bid":0.0,"Ask":0.0}]},{"H":"QuotesHub","M":"Update","A":[{"Time":0,"Symbol":"DAX","Bid":0.0,"Ask":0.0}]}]} 2015-02-16 10:02:27.368 BOP[7575:201923] Thread {number = 1, name = main}:__73-[SRAutoTransport start:connectionData:transportIndex:completionHandler:]_block_invoke [Line 123] [AUTO_TRANSPORT] did set active transport 2015-02-16 10:02:27.433 BOP[7575:201923] Thread {number = 1, name = main}:__64-[SRLongPollingTransport poll:connectionData:completionHandler:]_block_invoke [Line 115] [LONG_POLLING] LP Receive: {"C":"d-F194B7D3-ESt,0|ESu,22|ESv,2|ESw,0|ESx,0","S":1,"M":[]}

I keep getting 2015-02-16 11:24:23.902 BOP[8369:221220] Thread {number = 1, name = main}:__64-[SRLongPollingTransport poll:connectionData:completionHandler:]_block_invoke [Line 115] [LONG_POLLING] LP Receive: {"C":"d-F194B7D3-ESy,0|ESz,22|ES0,2|ES1,0","M":[]} every 1/2 minutes instead of data feed.
I have no idea what is going on right now and how to get it work. Anyone can help? thanks in advance.

  • You haven't stated what the issue is. You just show a bunch of log output with no explanation of any kind. And this is tagged as Objective-C. There's no Objective-C code in your question. – rmaddy Feb 16 '15 at 04:08
  • i apologize for did not state clearly my question. My question is when i build the app and it throw me the log as above. [SRLongPollingTransport poll:connectionData:completionHandler:]_block_invoke [Line 115] [LONG_POLLING] LP Receive: {"C":"d-F194B7D3-ESt,0|ESu,22|ESv,2|ESw,0|ESx,0","S":1,"M":[]} What is it mean for _block_invoke[Line 115] ? – Andrew Taylor Feb 16 '15 at 04:20

1 Answers1

0

The message you are receiving after every 1/2 min. state like you are connected with SignalR i.e HUB name that you want to connect. In your case that is "quotesHub".

Now you have to call hub invoke method. (the method name is scripted on .net side We have to call that function)

Let's take example : There is one function name as "send" on asp.net script side. For sending message I have to call that function. There is two parameter that used in that function. First is name and second is message.

By below code i can do that thing

    NSArray * ar = [[NSArray alloc] initWithObjects:@"Andrew Taylor",@"Hi", nil];
    [_hub invoke:@"send" withArgs:ar completionHandler:^(id response)
     {
         NSLog(@"hubResult %@",response);
     }];
Harin
  • 867
  • 11
  • 23