I am using object-c socketio(https://github.com/pkyeck/socket.IO-objc) to connect to my gevent-socketIO server, which works fine with my webpage.
CLIENT
[self.socketIO connectToHost:SOCKET_URL onPort:SOCKET_PORT];
SERVER
def socketio(request):
logger.info("Connecting start")
socketio_manage(
request.environ,
{'': BigSpoonNamespace, },
request=request
)
logger.info("Connecting finish")
return HttpResponse()
DJANGO LOG
2014-01-25 18:21:01,499 [DEBUG] socketio.virtsocket: Spawning sub-Socket Greenlet: send_into_ws 2014-01-25 18:21:01,500 [DEBUG] socketio.virtsocket: Spawning sub-Socket Greenlet: read_from_ws 2014-01-25 18:21:01,500 [DEBUG] socketio.virtsocket: Spawning sub-Socket Greenlet: _heartbeat 2014-01-25 18:21:01,500 [DEBUG] socketio.virtsocket: Spawning sub-Socket Greenlet: _heartbeat_timeout 2014-01-25 18:21:01,502 [INFO] root: Connecting start 2014-01-25 18:22:01,525 [DEBUG] socketio.virtsocket: heartbeat timed out, killing socket 2014-01-25 18:22:01,526 [DEBUG] socketio.virtsocket: Removing sessid='64962840572' client_queue[1] server_queue[1] hits=1 from
server sockets 2014-01-25 18:22:01,542 [INFO] root: Connecting finish
NGINX LOG
Traceback (most recent call last):
File "/home/ec2-user/webapps/2013-final-project-7/src/backend/env/lib/python2.6/site-packages/gevent/greenlet.py", line 327, in run
result = self._run(*self.args, **self.kwargs)
File "/home/ec2-user/webapps/2013-final-project-7/src/backend/env/src/gevent-socketio-master/socketio/transports.py", line 259, in read_from_ws
message = websocket.receive()
File "/home/ec2-user/webapps/2013-final-project-7/src/backend/env/src/gevent-websocket-master/geventwebsocket/websocket.py", line 296, in receive
result = self._receive()
File "/home/ec2-user/webapps/2013-final-project-7/src/backend/env/src/gevent-websocket-master/geventwebsocket/websocket.py", line 273, in _receive
raise WebSocketError('Received invalid close frame: %r %r' % (code, self.close_message))
WebSocketError: Received invalid close frame: 65535 bytearray(b'')
<Greenlet at 0x3340550: read_from_ws> failed with WebSocketError
So what's wrong here?
On the cliend
- (void) socketIODidConnect:(SocketIO *)socket{}
never get invoked. And the program always jump to the following after a few seconds.
- (void) socketIODidDisconnect:(SocketIO *)socket disconnectedWithError:(NSError *)error{}
Bummer!! My SocketIO.m and SRWebSocket.m File is modified to fix something warnings and obviously this breaks socketIO code... After use the original file, the issue is resolved. Now I want to slam my face to the keyboard..