Package common :: Module socks5 :: Class SocksQueue
[hide private]
[frames] | no frames]

Class SocksQueue

source code

Queue for all file requests objects
Instance Methods [hide private]
 
__init__(self, idlequeue, complete_transfer_cb=None, progress_transfer_cb=None, error_cb=None) source code
 
start_listener(self, port, sha_str, sha_handler, sid)
Start waiting for incomming connections on (host, port) and do a socks5 authentication using sid for generated SHA
source code
 
send_success_reply(self, file_props, streamhost) source code
 
connect_to_hosts(self, account, sid, on_success=None, on_failure=None) source code
 
_socket_connected(self, streamhost, file_props)
Called when there is a host connected to one of the senders's streamhosts.
source code
 
reconnect_receiver(self, receiver, streamhost)
Check the state of all streamhosts and if all has failed, then emit connection failure cb.
source code
 
_connection_refused(self, streamhost, file_props, idx)
Called when we loose connection during transfer
source code
 
add_receiver(self, account, sock5_receiver)
Add new file request
source code
 
get_file_from_sender(self, file_props, account) source code
 
result_sha(self, sha_str, idx) source code
 
activate_proxy(self, idx) source code
 
send_file(self, file_props, account) source code
 
add_file_props(self, account, file_props)
File_prop to the dict of current file_props.
source code
 
remove_file_props(self, account, sid) source code
 
get_file_props(self, account, sid)
Get fil_prop by account name and session id
source code
 
on_connection_accepted(self, sock) source code
 
process_result(self, result, actor)
[ 0, - 1 ] complete/end transfer [ > 0 ] send progress message [ None ] do nothing
source code
 
remove_receiver(self, idx, do_disconnect=True)
Remove reciver from the list and decrease the number of active connections with 1
source code
 
remove_sender(self, idx, do_disconnect=True)
Remove sender from the list of senders and decrease the number of active connections with 1
source code
Method Details [hide private]

__init__(self, idlequeue, complete_transfer_cb=None, progress_transfer_cb=None, error_cb=None)
(Constructor)

source code 

start_listener(self, port, sha_str, sha_handler, sid)

source code 
Start waiting for incomming connections on (host, port) and do a socks5 authentication using sid for generated SHA

send_success_reply(self, file_props, streamhost)

source code 

connect_to_hosts(self, account, sid, on_success=None, on_failure=None)

source code 

_socket_connected(self, streamhost, file_props)

source code 
Called when there is a host connected to one of the senders's streamhosts. Stop othere attempts for connections

reconnect_receiver(self, receiver, streamhost)

source code 
Check the state of all streamhosts and if all has failed, then emit connection failure cb. If there are some which are still not connected try to establish connection to one of them

_connection_refused(self, streamhost, file_props, idx)

source code 
Called when we loose connection during transfer

add_receiver(self, account, sock5_receiver)

source code 
Add new file request

get_file_from_sender(self, file_props, account)

source code 

result_sha(self, sha_str, idx)

source code 

activate_proxy(self, idx)

source code 

send_file(self, file_props, account)

source code 

add_file_props(self, account, file_props)

source code 
File_prop to the dict of current file_props. It is identified by account name and sid

remove_file_props(self, account, sid)

source code 

get_file_props(self, account, sid)

source code 
Get fil_prop by account name and session id

on_connection_accepted(self, sock)

source code 

process_result(self, result, actor)

source code 
Take appropriate actions upon the result:
[ 0, - 1 ] complete/end transfer [ > 0 ] send progress message [ None ] do nothing

remove_receiver(self, idx, do_disconnect=True)

source code 
Remove reciver from the list and decrease the number of active connections with 1

remove_sender(self, idx, do_disconnect=True)

source code 
Remove sender from the list of senders and decrease the number of active connections with 1