# Path: sockjs/cyclone/session.py
# class SESSION_STATE(Names):
# class BaseSession(object):
# class SessionMixin(object):
# class Session(BaseSession, SessionMixin):
# class MultiplexChannelSession(BaseSession):
#     CONNECTING = NamedConstant()
#     OPEN = NamedConstant()
#     CLOSING = NamedConstant()
#     CLOSED = NamedConstant()
#     def __init__(self, conn, server):
#     def set_handler(self, handler):
#     def verify_state(self):
#     def remove_handler(self, handler):
#     def close(self, code=3000, message='Go away!'):
#     def delayed_close(self):
#     def get_close_reason(self):
#     def is_closed(self):
#     def send_message(self, msg, stats=True):
#     def send_jsonified(self, msg, stats=True):
#     def broadcast(self, clients, msg):
#     def __init__(self, session_id=None, expiry=None, time_module=time):
#     def _random_key(self):
#     def is_alive(self):
#     def promote(self):
#     def on_delete(self, forced):
#     def __cmp__(self, other):
#     def __repr__(self):
#     def __init__(self, conn, server, session_id, expiry=None):
#     def on_delete(self, forced):
#     def set_handler(self, handler, start_heartbeat=True):
#     def verify_state(self):
#     def remove_handler(self, handler):
#     def send_message(self, msg, stats=True):
#     def send_jsonified(self, msg, stats=True):
#     def flush(self):
#     def close(self, code=3000, message='Go away!'):
#     def start_heartbeat(self):
#     def stop_heartbeat(self):
#     def delay_heartbeat(self):
#     def _heartbeat(self):
#     def messagesReceived(self, msg_list):
#     def __init__(self, conn, server, base, name):
#     def send_message(self, msg, stats=True):
#     def messageReceived(self, msg):
#     def close(self, code=3000, message='Go away!'):
#     def _close(self, code=3000, message='Go away!'):
# 
# Path: sockjs/cyclone/transports/base.py
# class BaseTransportMixin(object):
# class MultiplexTransport(BaseTransportMixin):
#     def get_conn_info(self):
#     def session_closed(self):
#     def __init__(self, conn_info):
#     def get_conn_info(self):
# 
# Path: sockjs/cyclone/websocket.py
# class WebSocketHandler(cyclone.websocket.WebSocketHandler):
#     def _execute(self, *args, **kwargs):
#     def _closeIfInvalidMethod(self):
#     def _writeAndClose(self, resp):
#     def _closeIfInvalidUpgradeHeader(self):
#     def _closeIfInvalidConnectionHeader(self):


from twisted.python import log
from sockjs.cyclone import session
from sockjs.cyclone.transports import base
from sockjs.cyclone import websocket



class RawSession(session.BaseSession):
    """ Raw session without any sockjs protocol encoding/decoding.
        Simply works as a proxy between C{SockJSConnection} class and
        C{RawWebSocketTransport}. """
    def send_message(self, msg, stats=True):
        self.handler.send_pack(msg)

    def messageReceived(self, msg):
        self.conn.messageReceived(msg)



# Path: sockjs/cyclone/session.py
# class SESSION_STATE(Names):
# class BaseSession(object):
# class SessionMixin(object):
# class Session(BaseSession, SessionMixin):
# class MultiplexChannelSession(BaseSession):
#     CONNECTING = NamedConstant()
#     OPEN = NamedConstant()
#     CLOSING = NamedConstant()
#     CLOSED = NamedConstant()
#     def __init__(self, conn, server):
#     def set_handler(self, handler):
#     def verify_state(self):
#     def remove_handler(self, handler):
#     def close(self, code=3000, message='Go away!'):
#     def delayed_close(self):
#     def get_close_reason(self):
#     def is_closed(self):
#     def send_message(self, msg, stats=True):
#     def send_jsonified(self, msg, stats=True):
#     def broadcast(self, clients, msg):
#     def __init__(self, session_id=None, expiry=None, time_module=time):
#     def _random_key(self):
#     def is_alive(self):
#     def promote(self):
#     def on_delete(self, forced):
#     def __cmp__(self, other):
#     def __repr__(self):
#     def __init__(self, conn, server, session_id, expiry=None):
#     def on_delete(self, forced):
#     def set_handler(self, handler, start_heartbeat=True):
#     def verify_state(self):
#     def remove_handler(self, handler):
#     def send_message(self, msg, stats=True):
#     def send_jsonified(self, msg, stats=True):
#     def flush(self):
#     def close(self, code=3000, message='Go away!'):
#     def start_heartbeat(self):
#     def stop_heartbeat(self):
#     def delay_heartbeat(self):
#     def _heartbeat(self):
#     def messagesReceived(self, msg_list):
#     def __init__(self, conn, server, base, name):
#     def send_message(self, msg, stats=True):
#     def messageReceived(self, msg):
#     def close(self, code=3000, message='Go away!'):
#     def _close(self, code=3000, message='Go away!'):
# 
# Path: sockjs/cyclone/transports/base.py
# class BaseTransportMixin(object):
# class MultiplexTransport(BaseTransportMixin):
#     def get_conn_info(self):
#     def session_closed(self):
#     def __init__(self, conn_info):
#     def get_conn_info(self):
# 
# Path: sockjs/cyclone/websocket.py
# class WebSocketHandler(cyclone.websocket.WebSocketHandler):
#     def _execute(self, *args, **kwargs):
#     def _closeIfInvalidMethod(self):
#     def _writeAndClose(self, resp):
#     def _closeIfInvalidUpgradeHeader(self):
#     def _closeIfInvalidConnectionHeader(self):


# Path: sockjs/cyclone/transports/rawwebsocket.py
from twisted.python import log
from sockjs.cyclone import session
from sockjs.cyclone.transports import base
from sockjs.cyclone import websocket




class RawSession(session.BaseSession):
    """ Raw session without any sockjs protocol encoding/decoding.
        Simply works as a proxy between C{SockJSConnection} class and
        C{RawWebSocketTransport}. """
    def send_message(self, msg, stats=True):
        self.handler.send_pack(msg)

    def messageReceived(self, msg):
        self.conn.messageReceived(msg)



class RawWebSocketTransport(websocket.WebSocketHandler, base.BaseTransportMixin):