Package vmd :: Module control :: Class client
[hide private]
[frames] | no frames]

Class client

source code

asyncore.dispatcher --+    
                      |    
    asynchat.async_chat --+
                          |
                         client
Known Subclasses:

one command -> response exchange between the client and vmd::

   c = client(host,port=5555)
   c.cmd(tcl, tcl,...)
   asyncore.loop()

Starting VMD as ``vmd -e remote_ctl.tcl`` opens port 5555 for connection.
The client only becomes active in the ``asyncore.loop()`` and exits after
sending the commands and receiving the response. The response is available
as :meth:`client.response`

:Parameters:
   host
       currently remote_ctl.tcl only allows 'localhost'
   port
       port to connect to (typically 5555)

:Methods:
  :meth:`client.cmd`
    commands (with embedded newlines!) scheduled for sending and execution in VMD
  :meth:`client.response`
    response from VMD

:Bugs: Somehow it doesnt like many commands...

Instance Methods [hide private]
 
__init__(self, host, port=5555) source code
 
handle_connect(self) source code
 
collect_incoming_data(self, data)
buffer incoming data
source code
 
found_terminator(self) source code
 
cmd(self, *tcl)
Submits the commands to be executed in VMD:
source code
 
response(self) source code

Inherited from asynchat.async_chat: close_when_done, discard_buffers, get_terminator, handle_close, handle_read, handle_write, initiate_send, push, push_with_producer, readable, refill_buffer, set_terminator, writable

Inherited from asyncore.dispatcher: __getattr__, __repr__, accept, add_channel, bind, close, connect, create_socket, del_channel, handle_accept, handle_error, handle_expt, handle_expt_event, handle_read_event, handle_write_event, listen, log, log_info, recv, send, set_reuse_addr, set_socket

Class Variables [hide private]

Inherited from asynchat.async_chat: ac_in_buffer_size, ac_out_buffer_size

Inherited from asyncore.dispatcher: accepting, addr, closing, connected, debug

Method Details [hide private]

__init__(self, host, port=5555)
(Constructor)

source code 
Overrides: asyncore.dispatcher.__init__

handle_connect(self)

source code 
Overrides: asyncore.dispatcher.handle_connect

collect_incoming_data(self, data)

source code 
buffer incoming data
Overrides: asynchat.async_chat.collect_incoming_data

found_terminator(self)

source code 
Overrides: asynchat.async_chat.found_terminator

cmd(self, *tcl)

source code 

Submits the commands to be executed in VMD:

c.cmd(tcl, tcl, ...)

Commands (with embedded newlines!) scheduled for sending and execution in VMD. All strings will be executed sequentially.