core.net | index

`Net support to the python vert.x platform`

Modules

``

core |  |  |

Classes

``

core.ssl_support.SSLSupport(__builtin__.object)
  NetClient(core.ssl_support.SSLSupport, core.tcp_support.TCPSupport)
  NetServer(core.ssl_support.SSLSupport, core.tcp_support.TCPSupport)
core.streams.ReadStream(__builtin__.object)
  NetSocket(core.streams.ReadStream, core.streams.WriteStream)
core.streams.WriteStream(__builtin__.object)
  NetSocket(core.streams.ReadStream, core.streams.WriteStream)
core.tcp_support.TCPSupport(__builtin__.object)
  NetClient(core.ssl_support.SSLSupport, core.tcp_support.TCPSupport)
  NetServer(core.ssl_support.SSLSupport, core.tcp_support.TCPSupport)
org.vertx.java.core.Handler(java.lang.Object)
  org.python.proxies.core.net$ConnectHandler$15(org.vertx.java.core.Handler, java.lang.Object)
    ConnectHandler

class ConnectHandler(org.python.proxies.core.net$ConnectHandler$15)
`` | `Connection handler`

Method resolution order:
  ConnectHandler
  org.python.proxies.core.net$ConnectHandler$15
  org.vertx.java.core.Handler
  java.lang.Object
  __builtin__.object

Methods defined here:

__init__(self, handler)

handle(self, socket)
  `Call the handler after connection is established`

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

Data and other attributes defined here:

__initProxy__ = <java function __initProxy__ 0xaa>

__supernames__ = array('java.lang.String', [u'clone', u'finalize'])

classDictInit = <java function classDictInit 0xab>

clone = <java function clone 0xac>

finalize = <java function finalize 0xad>

Methods inherited from java.lang.Object:

__copy__(...)

__deepcopy__(...)

__eq__(...)

__hash__(...)

__ne__(...)

__repr__(...)

__unicode__(...)

Data and other attributes inherited from java.lang.Object:

equals = <java function equals 0xae>

getClass = <java function getClass 0xaf>

hashCode = <java function hashCode 0xb0>

notify = <java function notify 0xb1>

notifyAll = <java function notifyAll 0xb2>

toString = <java function toString 0xb3>

wait = <java function wait 0xb4>

class NetClient(core.ssl_support.SSLSupport, core.tcp_support.TCPSupport)
`` | `NetClient is an asynchronous factory for TCP or SSL connections. Multiple connections to different servers can be made using the same instance.`

Method resolution order:
  NetClient
  core.ssl_support.SSLSupport
  core.tcp_support.TCPSupport
  __builtin__.object

Methods defined here:

__init__(self, **kwargs)

close(self)
  `Close the NetClient. Any open connections will be closed.`

connect(self, port, host, handler)
  `Attempt to open a connection to a server. The connection is opened asynchronously and the result returned in the
  handler.
  Keyword arguments:
  @param port: The port to connect to.
  @param host: The host or ip address to connect to.
  @param handler: The connection handler
  @return: a reference to self so invocations can be chained`

set_trust_all(self, val)
  `Should the client trust ALL server certificates
  Keyword arguments:
  @param val: If val is set to true then the client will trust ALL server certificates and will not attempt to authenticate them
  against it's local client trust store. The default value is false.
  Use this method with caution!
  @return: a reference to self so invocations can be chained`

Data descriptors defined here:

trust_all

Methods inherited from core.ssl_support.SSLSupport:

set_key_store_password(self, password)
  `Set the password for the SSL key store. This method should only be used with the client in SSL mode, i.e. after ssl
  has been set to true.
  Keyword arguments:
  @param password: The password.
  return self. So multiple invocations can be chained.`

set_key_store_path(self, path)
  `Set the path to the SSL key store. This method should only be used with the client/server in SSL mode, i.e. after {#ssl=}
  has been set to true.
  The SSL key store is a standard Java Key Store, and should contain the client/server certificate. For a client, it's only necessary to supply
  a client key store if the server requires client authentication via client certificates.
  Keyword arguments:
  @param path: The path to the key store
  return self. So multiple invocations can be chained.`

set_ssl(self, val)
  `Set whether the server or client will use SSL.
  Keyword arguments:
  @param val: If true then ssl will be used.
  return self. So multiple invocations can be chained.`

set_trust_store_password(self, password)
  `Set the password for the SSL trust store. This method should only be used with the client in SSL mode, i.e. after {#ssl=}
  has been set to true.
  Keyword arguments:
  @param password: The password.
  return self. So multiple invocations can be chained.`

set_trust_store_path(self, path)
  `Set the path to the SSL trust store. This method should only be used with the client/server in SSL mode, i.e. after {#ssl=}
  has been set to true.
  The SSL trust store is a standard Java Key Store, and should contain the certificate(s) of the clients/servers that the server/client trusts. The SSL
  handshake will fail if the server provides a certificate that the client does not trust, or if client authentication is used,
  if the client provides a certificate the server does not trust.
  Keyword arguments:
  @param path: The path to the trust store
  return self. So multiple invocations can be chained.`

Data descriptors inherited from core.ssl_support.SSLSupport:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

key_store_password

key_store_path

ssl

trust_store_password

trust_store_path

Methods inherited from core.tcp_support.TCPSupport:

set_receive_buffer_size(self, bytes)
  `Set the TCP receive buffer size.
  Keyword arguments:
  @param bytes: The size in bytes.
  return a reference to self so invocations can be chained`

set_reuse_address(self, val)
  `Set the TCP reuse address setting.
  Keyword arguments:
  @param val: If true, then TCP reuse address will be enabled.
  @return: a reference to self so invocations can be chained`

set_send_buffer_size(self, bytes)
  `Set the TCP send buffer size.
  Keyword arguments:
  @param bytes: The size in bytes.
  return a reference to self so invocations can be chained`

set_so_linger(self, val)
  `Set the TCP so linger setting.
  Keyword arguments:
  @param val: If true, then TCP so linger will be enabled.
  return a reference to self so invocations can be chained`

set_tcp_keep_alive(self, val)
  `Set the TCP keep alive setting.
  Keyword arguments:
  @param val: If true, then TCP keep alive will be enabled.
  return a reference to self so invocations can be chained`

set_traffic_class(self, val)
  `Set the TCP traffic class setting.
  Keyword arguments:
  @param val: The TCP traffic class setting.
  return a reference to self so invocations can be chained`

Data descriptors inherited from core.tcp_support.TCPSupport:

receive_buffer_size

reuse_address

send_buffer_size

so_linger

tcp_keep_alive

traffic_class

class NetServer(core.ssl_support.SSLSupport, core.tcp_support.TCPSupport)
`` | `Represents a TCP or SSL Server When connections are accepted by the server they are supplied to the user in the form of a NetSocket instance that is passed via the handler set using connect_handler.`

Method resolution order:
  NetServer
  core.ssl_support.SSLSupport
  core.tcp_support.TCPSupport
  __builtin__.object

Methods defined here:

__init__(self, **kwargs)

close(self, handler=None)
  `Close the server. The handler will be called when the close is complete.`

connect_handler(self, handler)
  `Supply a connect handler for this server. The server can only have at most one connect handler at any one time.
  As the server accepts TCP or SSL connections it creates an instance of NetSocket and passes it to the
  connect handler.
  Keyword arguments:
  @param handler: connection handler
  @return: a reference to self so invocations can be chained`

listen(self, port, host='0.0.0.0')
  `Instruct the server to listen for incoming connections.
  Keyword arguments:
  @param port: The port to listen on.
  @param host: The host name or ip address to listen on.
  @return: a reference to self so invocations can be chained`

set_client_auth_required(self, val)
  `Client authentication is an extra level of security in SSL, and requires clients to provide client certificates.
  Those certificates must be added to the server trust store.
  @param val: If true then the server will request client authentication from any connecting clients, if they
  do not authenticate then they will not make a connection.`

Data descriptors defined here:

client_auth_required

Methods inherited from core.ssl_support.SSLSupport:

set_key_store_password(self, password)
  `Set the password for the SSL key store. This method should only be used with the client in SSL mode, i.e. after ssl
  has been set to true.
  Keyword arguments:
  @param password: The password.
  return self. So multiple invocations can be chained.`

set_key_store_path(self, path)
  `Set the path to the SSL key store. This method should only be used with the client/server in SSL mode, i.e. after {#ssl=}
  has been set to true.
  The SSL key store is a standard Java Key Store, and should contain the client/server certificate. For a client, it's only necessary to supply
  a client key store if the server requires client authentication via client certificates.
  Keyword arguments:
  @param path: The path to the key store
  return self. So multiple invocations can be chained.`

set_ssl(self, val)
  `Set whether the server or client will use SSL.
  Keyword arguments:
  @param val: If true then ssl will be used.
  return self. So multiple invocations can be chained.`

set_trust_store_password(self, password)
  `Set the password for the SSL trust store. This method should only be used with the client in SSL mode, i.e. after {#ssl=}
  has been set to true.
  Keyword arguments:
  @param password: The password.
  return self. So multiple invocations can be chained.`

set_trust_store_path(self, path)
  `Set the path to the SSL trust store. This method should only be used with the client/server in SSL mode, i.e. after {#ssl=}
  has been set to true.
  The SSL trust store is a standard Java Key Store, and should contain the certificate(s) of the clients/servers that the server/client trusts. The SSL
  handshake will fail if the server provides a certificate that the client does not trust, or if client authentication is used,
  if the client provides a certificate the server does not trust.
  Keyword arguments:
  @param path: The path to the trust store
  return self. So multiple invocations can be chained.`

Data descriptors inherited from core.ssl_support.SSLSupport:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

key_store_password

key_store_path

ssl

trust_store_password

trust_store_path

Methods inherited from core.tcp_support.TCPSupport:

set_receive_buffer_size(self, bytes)
  `Set the TCP receive buffer size.
  Keyword arguments:
  @param bytes: The size in bytes.
  return a reference to self so invocations can be chained`

set_reuse_address(self, val)
  `Set the TCP reuse address setting.
  Keyword arguments:
  @param val: If true, then TCP reuse address will be enabled.
  @return: a reference to self so invocations can be chained`

set_send_buffer_size(self, bytes)
  `Set the TCP send buffer size.
  Keyword arguments:
  @param bytes: The size in bytes.
  return a reference to self so invocations can be chained`

set_so_linger(self, val)
  `Set the TCP so linger setting.
  Keyword arguments:
  @param val: If true, then TCP so linger will be enabled.
  return a reference to self so invocations can be chained`

set_tcp_keep_alive(self, val)
  `Set the TCP keep alive setting.
  Keyword arguments:
  @param val: If true, then TCP keep alive will be enabled.
  return a reference to self so invocations can be chained`

set_traffic_class(self, val)
  `Set the TCP traffic class setting.
  Keyword arguments:
  @param val: The TCP traffic class setting.
  return a reference to self so invocations can be chained`

Data descriptors inherited from core.tcp_support.TCPSupport:

receive_buffer_size

reuse_address

send_buffer_size

so_linger

tcp_keep_alive

traffic_class

class NetSocket(core.streams.ReadStream, core.streams.WriteStream)
`` | `NetSocket is a socket-like abstraction used for reading from or writing to TCP connections.`

Method resolution order:
  NetSocket
  core.streams.ReadStream
  core.streams.WriteStream
  __builtin__.object

Methods defined here:

__init__(self, j_socket)

close(self)
  `Close the socket`

closed_handler(self, handler)
  `Set a closed handler on the socket.
  Keyword arguments:
  @param handler: A block to be used as the handler`

send_file(self, file_path)
  `Tell the kernel to stream a file directly from disk to the outgoing connection, bypassing userspace altogether
  (where supported by the underlying operating system. This is a very efficient way to stream files.
  Keyword arguments:
  @param file_path: Path to file to send.`

write_buffer(self, buffer, handler=None)
  `Write a Buffer to the socket. The handler will be called when the buffer has actually been written to the wire.
  Keyword arguments:
  @param buffer: The buffer to write.
  @param handler: The handler to call on completion.`

write_str(self, str, enc='UTF-8', handler=None)
  `Write a String to the socket. The handler will be called when the string has actually been written to the wire.
  Keyword arguments:
  @param str: The string to write.
  @param enc: The encoding to use.
  @param handler: The handler to call on completion.`

Methods inherited from core.streams.ReadStream:

data_handler(self, handler)
  `Set a data handler. As data is read, the handler will be called with the data.
  Keyword arguments:
  @param handler: The data handler`

end_handler(self, handler)
  `Set an end handler on the stream. Once the stream has ended, and there is no more data to be read, this handler will be called.
  Keyword arguments:
  @param handler: The exception handler`

exception_handler(self, handler)
  `Set an execption handler on the stream.
  param [Block] hndlr. The exception handler`

pause(self)
  `Pause the ReadStream. After calling this, the ReadStream will aim to send no more data to the`

resume(self)
  `Resume reading. If the ReadStream has been paused, reading will recommence on it.`

Data descriptors inherited from core.streams.ReadStream:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

Methods inherited from core.streams.WriteStream:

drain_handler(self, handler)
  `Set a drain handler on the stream. If the write queue is full, then the handler will be called when the write
  queue has been reduced to maxSize / 2. See for an example of this being used.
  Keyword arguments:
  @param handler: The drain handler`

set_write_queue_max_size(self, size)
  `Set the maximum size of the write queue. You will still be able to write to the stream even
  if there is more data than this in the write queue. This is used as an indicator by classes such as
  to provide flow control.
  Keyword arguments:
  @param size: The maximum size, in bytes.`

Data descriptors inherited from core.streams.WriteStream:

write_queue_full
  `Is the write queue full?
  return True if there are more bytes in the write queue than the max write queue size.`

write_queue_max_size

Data
`` |  | __author__ = 'Scott Horn' __credits__ = 'Based entirely on work by Tim Fox http://tfox.org' __email__ = 'scott@hornmicro.com' org = <java package org 0x2>

Author
`` |  | Scott Horn

Credits
`` |  | Based entirely on work by Tim Fox http://tfox.org