Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
tornado.iostream.SSLIOStream Class Reference
Inheritance diagram for tornado.iostream.SSLIOStream:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def connect
def read_from_fd
def reading
def writing

Public Attributes

 socket

Private Member Functions

def _do_ssl_handshake
def _handle_connect
def _handle_read
def _handle_write
def _verify_cert

Private Attributes

 _handshake_reading
 _handshake_writing
 _server_hostname
 _ssl_accepting
 _ssl_connect_callback
 _ssl_options
 _state

Detailed Description

A utility class to write to and read from a non-blocking SSL socket.

If the socket passed to the constructor is already connected,
it should be wrapped with::

    ssl.wrap_socket(sock, do_handshake_on_connect=False, **kwargs)

before constructing the `SSLIOStream`.  Unconnected sockets will be
wrapped when `IOStream.connect` is finished.

Definition at line 1121 of file iostream.py.


Constructor & Destructor Documentation

def tornado.iostream.SSLIOStream.__init__ (   self,
  args,
  kwargs 
)
The ``ssl_options`` keyword argument may either be a dictionary
of keywords arguments for `ssl.wrap_socket`, or an `ssl.SSLContext`
object.

Definition at line 1132 of file iostream.py.


Member Function Documentation

Definition at line 1162 of file iostream.py.

Reimplemented from tornado.iostream.IOStream.

Definition at line 1254 of file iostream.py.

Reimplemented from tornado.iostream.BaseIOStream.

Definition at line 1232 of file iostream.py.

Reimplemented from tornado.iostream.BaseIOStream.

Definition at line 1238 of file iostream.py.

def tornado.iostream.SSLIOStream._verify_cert (   self,
  peercert 
) [private]
Returns True if peercert is valid according to the configured
validation mode and hostname.

The ssl handshake already tested the certificate for a valid
CA signature; the only thing that remains is to check
the hostname.

Definition at line 1205 of file iostream.py.

def tornado.iostream.SSLIOStream.connect (   self,
  address,
  callback = None,
  server_hostname = None 
)
Connects the socket to a remote address without blocking.

May only be called if the socket passed to the constructor was
not previously connected.  The address parameter is in the
same format as for `socket.connect <socket.socket.connect>` for
the type of socket passed to the IOStream constructor,
e.g. an ``(ip, port)`` tuple.  Hostnames are accepted here,
but will be resolved synchronously and block the IOLoop.
If you have a hostname instead of an IP address, the `.TCPClient`
class is recommended instead of calling this method directly.
`.TCPClient` will do asynchronous DNS resolution and handle
both IPv4 and IPv6.

If ``callback`` is specified, it will be called with no
arguments when the connection is completed; if not this method
returns a `.Future` (whose result after a successful
connection will be the stream itself).

If specified, the ``server_hostname`` parameter will be used
in SSL connections for certificate validation (if requested in
the ``ssl_options``) and SNI (if supported; requires
Python 3.2+).

Note that it is safe to call `IOStream.write
<BaseIOStream.write>` while the connection is pending, in
which case the data will be written as soon as the connection
is ready.  Calling `IOStream` read methods before the socket is
connected works on some platforms but is non-portable.

.. versionchanged:: 4.0
    If no callback is given, returns a `.Future`.

Reimplemented from tornado.iostream.IOStream.

Definition at line 1244 of file iostream.py.

Attempts to read from the underlying file.

Returns ``None`` if there was nothing to read (the socket
returned `~errno.EWOULDBLOCK` or equivalent), otherwise
returns the data.  When possible, should return no more than
``self.read_chunk_size`` bytes at a time.

Reimplemented from tornado.iostream.IOStream.

Definition at line 1277 of file iostream.py.

Returns true if we are currently reading from the stream.

Reimplemented from tornado.iostream.BaseIOStream.

Definition at line 1156 of file iostream.py.

Returns true if we are currently writing to the stream.

Reimplemented from tornado.iostream.BaseIOStream.

Definition at line 1159 of file iostream.py.


Member Data Documentation

Definition at line 1135 of file iostream.py.

Definition at line 1135 of file iostream.py.

Definition at line 1135 of file iostream.py.

Definition at line 1135 of file iostream.py.

Definition at line 1135 of file iostream.py.

Definition at line 1135 of file iostream.py.

Reimplemented from tornado.iostream.BaseIOStream.

Definition at line 1254 of file iostream.py.

Reimplemented from tornado.iostream.IOStream.

Definition at line 1254 of file iostream.py.


The documentation for this class was generated from the following file:


rosbridge_server
Author(s): Jonathan Mace
autogenerated on Thu Aug 27 2015 14:50:40