0

object-c socketio ( https://github.com/pkyeck/socket.IO-objc ) を使用して gevent-socketIO サーバーに接続しています。これは、私の Web ページで正常に動作します。

クライアント

[self.socketIO connectToHost:SOCKET_URL onPort:SOCKET_PORT];

サーバ

def socketio(request):
    logger.info("Connecting start")
    socketio_manage(
        request.environ,
        {'': BigSpoonNamespace, },
        request=request
    )
    logger.info("Connecting finish")
    return HttpResponse() 

ジャンゴログ

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: 接続完了

NGINX ログ

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

ここで何が問題なのですか?

クライアント上

- (void) socketIODidConnect:(SocketIO *)socket{}

呼び出されることはありません。そして、プログラムは常に数秒後に次のようにジャンプします。

- (void) socketIODidDisconnect:(SocketIO *)socket disconnectedWithError:(NSError *)error{}  
4

1 に答える 1