### Navigation

- index
- modules |
- gevent-socketio 0.3.1 documentation »

# `socketio.transports`

This is largely an internal module, responsible for translating the different fallback mechanisms to one abstracted Socket, dealing with payload encoding, multi-message multiplexing and their reverse operation.

class `socketio.transports.``BaseTransport`(handler, config, **kwargs)

  Bases: `object`

  Base class for all transports. Mostly wraps handler class functions.

  `start_response`(status, headers, **kwargs)
  `write`(data='')

class `socketio.transports.``FlashSocketTransport`(handler, config, **kwargs)

  Bases: `socketio.transports.WebsocketTransport`

class `socketio.transports.``HTMLFileTransport`(handler, config)

  Bases: `socketio.transports.XHRPollingTransport`

  Not tested at all!

  `do_exchange`(socket, request_method)
  `get`(socket)
  `write`(data)
  `write_packed`(data)

class `socketio.transports.``JSONPolling`(handler, config)

  Bases: `socketio.transports.XHRPollingTransport`

  `write`(data)

    Just quote out stuff before sending it out

class `socketio.transports.``WebsocketTransport`(handler, config, **kwargs)

  Bases: `socketio.transports.BaseTransport`

  `do_exchange`(socket, request_method)

class `socketio.transports.``XHRMultipartTransport`(handler)

  Bases: `socketio.transports.XHRPollingTransport`

  `do_exchange`(socket, request_method)
  `get`(socket)

class `socketio.transports.``XHRPollingTransport`(*args, **kwargs)

  Bases: `socketio.transports.BaseTransport`

  `decode_payload`(payload)

    This function can extract multiple messages from one HTTP payload. Some times, the XHR/JSONP/.. transports can pack more than one message on a single packet. They are encoding following the WebSocket semantics, which need to be reproduced here to unwrap the messages.

    The semantics are:

    > ufffd + [length as a string] + ufffd + [payload as a unicode string]

    This function returns a list of messages, even though there is only one.

    Inspired by socket.io/lib/transports/http.js

  `do_exchange`(socket, request_method)
  `encode_payload`(messages)

    Encode list of messages. Expects messages to be unicode.

    `messages` - List of raw messages to encode, if necessary

  `get`(socket)
  `get_messages_payload`(socket, timeout=None)

    This will fetch the messages from the Socket’s queue, and if there are many messes, pack multiple messages in one payload and return

  `options`()
  `post`(socket)

### Navigation

- index
- modules |
- gevent-socketio 0.3.1 documentation »