ios - NSInputStream send NSStreamEventEndEncountered after Facebook connexion -
i use socketio project on ios app connect node.js server , works great until choose connect facebook. when connect facebook send data server , answer data "user connected, user created in database" etc. , after that, nsinputstream seems @ 0 , connexion closed. don't know do, spent 14 hours on , still issue...
can me ?
edit: looks problem in srwebsocket.m line 1462
for more details added log :
case nsstreameventhasbytesavailable: { srfastlog(@"nsstreameventhasbytesavailable %@", astream); const int buffersize = 2048; uint8_t buffer[buffersize]; while (_inputstream.hasbytesavailable) { int bytes_read = [_inputstream read:buffer maxlength:buffersize]; dispatch_async(dispatch_get_main_queue(), ^{ nslog(@"bytes_read = %i", bytes_read); }); if (bytes_read > 0) { [_readbuffer appendbytes:buffer length:bytes_read]; } else if (bytes_read < 0) { dispatch_async(dispatch_get_main_queue(), ^{ nslog(@"error = %@", _inputstream.streamerror); }); [self _failwitherror:_inputstream.streamerror]; } if (bytes_read != buffersize) { break; } }; [self _pumpscanner]; break; }
and result :
ondata 5:::{"name":"initallogin","args":[{"guid":"af78bdf0-f17d-ede2-7dd6-22708d1330f7","usedwithfacebook":true}]} start/reset timeout currrent size = 0 read buffer lentgh = 373 event currrent size = 0 bytes_read = 0 nsstreameventendencountered <__nscfinputstream: 0xab21660> reason = stream end encountered ondisconnect() deconnexion = operation couldn’t completed. (socketioerror error -4.)
Comments
Post a Comment