Class: ZMachine::Connection
- Inherits:
-
Object
- Object
- ZMachine::Connection
- Extended by:
- Forwardable
- Defined in:
- lib/zmachine/connection.rb
Instance Attribute Summary collapse
-
#channel ⇒ Object
Returns the value of attribute channel.
Class Method Summary collapse
Instance Method Summary collapse
- #close_connection_after_writing ⇒ Object
- #comm_inactivity_timeout ⇒ Object
- #comm_inactivity_timeout=(value) ⇒ Object (also: #set_comm_inactivity_timeout)
- #connection_completed ⇒ Object
- #detach ⇒ Object
- #error? ⇒ Boolean
- #get_idle_time ⇒ Object
- #get_peer_cert ⇒ Object
- #get_peername ⇒ Object
- #get_pid ⇒ Object
- #get_proxied_bytes ⇒ Object
- #get_sockname ⇒ Object
- #get_status ⇒ Object
-
#initialize(*args, &block) ⇒ Connection
constructor
A new instance of Connection.
- #notify_readable=(mode) ⇒ Object
- #notify_readable? ⇒ Boolean
- #notify_writable=(mode) ⇒ Object
- #notify_writable? ⇒ Boolean
- #pause ⇒ Object
- #paused? ⇒ Boolean
- #pending_connect_timeout=(value) ⇒ Object (also: #set_pending_connect_timeout)
-
#post_init ⇒ Object
callbacks.
- #proxy_completed ⇒ Object
- #proxy_incoming_to(conn, bufsize = 0) ⇒ Object
- #proxy_target_unbound ⇒ Object
- #receive_data(data) ⇒ Object
- #resume ⇒ Object
- #send_datagram(data, recipient_address, recipient_port) ⇒ Object
- #send_file_data(filename) ⇒ Object
- #ssl_handshake_completed ⇒ Object
- #ssl_verify_peer(cert) ⇒ Object
- #start_tls(args = {}) ⇒ Object
- #stop_proxying ⇒ Object
- #stream_file_data(filename, args = {}) ⇒ Object
- #unbind ⇒ Object
Constructor Details
#initialize(*args, &block) ⇒ Connection
Returns a new instance of Connection.
19 20 |
# File 'lib/zmachine/connection.rb', line 19 def initialize(*args, &block) end |
Instance Attribute Details
#channel ⇒ Object
Returns the value of attribute channel.
4 5 6 |
# File 'lib/zmachine/connection.rb', line 4 def channel @channel end |
Class Method Details
.new(channel, *args, &block) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/zmachine/connection.rb', line 10 def self.new(channel, *args, &block) allocate.instance_eval do @channel = channel initialize(*args, &block) post_init self end end |
Instance Method Details
#close_connection_after_writing ⇒ Object
40 41 42 |
# File 'lib/zmachine/connection.rb', line 40 def close_connection_after_writing close_connection(true) end |
#comm_inactivity_timeout ⇒ Object
44 45 |
# File 'lib/zmachine/connection.rb', line 44 def comm_inactivity_timeout end |
#comm_inactivity_timeout=(value) ⇒ Object Also known as: set_comm_inactivity_timeout
47 48 |
# File 'lib/zmachine/connection.rb', line 47 def comm_inactivity_timeout=(value) end |
#connection_completed ⇒ Object
27 28 |
# File 'lib/zmachine/connection.rb', line 27 def connection_completed end |
#detach ⇒ Object
52 53 54 |
# File 'lib/zmachine/connection.rb', line 52 def detach _not_implemented end |
#error? ⇒ Boolean
56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/zmachine/connection.rb', line 56 def error? errno = ZMachine::report_connection_error_status(@signature) case errno when 0 false when -1 true else Errno::constants.select do |name| Errno.__send__(:const_get, name)::Errno == errno end.first end end |
#get_idle_time ⇒ Object
70 71 72 |
# File 'lib/zmachine/connection.rb', line 70 def get_idle_time _not_implemented end |
#get_peer_cert ⇒ Object
74 75 76 |
# File 'lib/zmachine/connection.rb', line 74 def get_peer_cert _not_implemented end |
#get_peername ⇒ Object
78 79 80 81 82 |
# File 'lib/zmachine/connection.rb', line 78 def get_peername if peer = @channel.peer_name ::Socket.pack_sockaddr_in(*peer) end end |
#get_pid ⇒ Object
84 85 86 |
# File 'lib/zmachine/connection.rb', line 84 def get_pid _not_implemented end |
#get_proxied_bytes ⇒ Object
88 89 90 |
# File 'lib/zmachine/connection.rb', line 88 def get_proxied_bytes _not_implemented end |
#get_sockname ⇒ Object
94 95 96 97 98 |
# File 'lib/zmachine/connection.rb', line 94 def get_sockname if sock_name = @channel.sock_name ::Socket.pack_sockaddr_in(*sock_name) end end |
#get_status ⇒ Object
100 101 |
# File 'lib/zmachine/connection.rb', line 100 def get_status end |
#notify_readable=(mode) ⇒ Object
103 104 105 |
# File 'lib/zmachine/connection.rb', line 103 def notify_readable=(mode) _not_implemented end |
#notify_readable? ⇒ Boolean
107 108 109 |
# File 'lib/zmachine/connection.rb', line 107 def notify_readable? _not_implemented end |
#notify_writable=(mode) ⇒ Object
111 112 113 |
# File 'lib/zmachine/connection.rb', line 111 def notify_writable=(mode) _not_implemented end |
#notify_writable? ⇒ Boolean
115 116 117 |
# File 'lib/zmachine/connection.rb', line 115 def notify_writable? _not_implemented end |
#pause ⇒ Object
119 120 121 |
# File 'lib/zmachine/connection.rb', line 119 def pause _not_implemented end |
#paused? ⇒ Boolean
123 124 125 |
# File 'lib/zmachine/connection.rb', line 123 def paused? _not_implemented end |
#pending_connect_timeout=(value) ⇒ Object Also known as: set_pending_connect_timeout
127 128 |
# File 'lib/zmachine/connection.rb', line 127 def pending_connect_timeout=(value) end |
#post_init ⇒ Object
callbacks
24 25 |
# File 'lib/zmachine/connection.rb', line 24 def post_init end |
#proxy_completed ⇒ Object
132 133 134 |
# File 'lib/zmachine/connection.rb', line 132 def proxy_completed _not_implemented end |
#proxy_incoming_to(conn, bufsize = 0) ⇒ Object
136 137 138 |
# File 'lib/zmachine/connection.rb', line 136 def proxy_incoming_to(conn, bufsize = 0) _not_implemented end |
#proxy_target_unbound ⇒ Object
140 141 142 |
# File 'lib/zmachine/connection.rb', line 140 def proxy_target_unbound _not_implemented end |
#receive_data(data) ⇒ Object
30 31 |
# File 'lib/zmachine/connection.rb', line 30 def receive_data(data) end |
#resume ⇒ Object
144 145 146 |
# File 'lib/zmachine/connection.rb', line 144 def resume _not_implemented end |
#send_datagram(data, recipient_address, recipient_port) ⇒ Object
150 151 152 |
# File 'lib/zmachine/connection.rb', line 150 def send_datagram(data, recipient_address, recipient_port) _not_implemented end |
#send_file_data(filename) ⇒ Object
154 155 156 |
# File 'lib/zmachine/connection.rb', line 154 def send_file_data(filename) _not_implemented end |
#ssl_handshake_completed ⇒ Object
160 161 162 |
# File 'lib/zmachine/connection.rb', line 160 def ssl_handshake_completed _not_implemented end |
#ssl_verify_peer(cert) ⇒ Object
164 165 166 |
# File 'lib/zmachine/connection.rb', line 164 def ssl_verify_peer(cert) _not_implemented end |
#start_tls(args = {}) ⇒ Object
168 169 170 |
# File 'lib/zmachine/connection.rb', line 168 def start_tls(args = {}) _not_implemented end |
#stop_proxying ⇒ Object
172 173 174 |
# File 'lib/zmachine/connection.rb', line 172 def _not_implemented end |
#stream_file_data(filename, args = {}) ⇒ Object
176 177 178 |
# File 'lib/zmachine/connection.rb', line 176 def stream_file_data(filename, args = {}) _not_implemented end |
#unbind ⇒ Object
33 34 |
# File 'lib/zmachine/connection.rb', line 33 def unbind end |