i developing iphone app (using ios 9 beta). using socket connections using socketrocket client library. when try establish wss connection invalid host name, don't error on opening socket, connection or on sending data, whenever try run program seems information host correct , data being sent.
i using current version of socketrocket library, have added srwebsocket.h, srwebsocket.m , socketrocket-prefix.pch files in project. following part of code have:
nsstring* url = [nsstring stringwithformat:@"wss://%@/myproject/stream?data=%d", websockethost, dummydata]; srwebsocket *websocket = [[srwebsocket alloc] initwithurlrequest:[nsurlrequest requestwithurl:[nsurl urlwithstring:url]]]; websocket.delegate = self; // open websocket [websocket open]; // send message websocket [websocket send:[self getjsonstring:parameters]]; // close websocket [websocket close]; websocket = nil; if pass random host name "abc.def" variable websockethost, still run smoothly (i have try-catch blocks surrounding above code, , tried put break points in between , debugged line line). , when don't have internet connection phone, there aren't errors thrown.
does know problem?
thanks!
are implementing delegate method? library won't throw error when call [websocket open], call method if can't connect endpoint sometime in future since establishing connection asynchronous operation.
- (void)websocket:(srwebsocket *)websocket didfailwitherror:(nserror *)error;
Comments
Post a Comment