Class: TestLineAndTextProtocol::BinaryTextTest
- Inherits:
-
EventMachine::Protocols::LineAndTextProtocol
- Object
- EventMachine::Connection
- EventMachine::Protocols::LineAndTextProtocol
- TestLineAndTextProtocol::BinaryTextTest
- Defined in:
- lib/ext/eventmachine-0.12.10/tests/test_ltp.rb
Constant Summary
Constants inherited from EventMachine::Protocols::LineAndTextProtocol
EventMachine::Protocols::LineAndTextProtocol::MaxBinaryLength, EventMachine::Protocols::LineAndTextProtocol::MaxLineLength
Instance Attribute Summary
Attributes inherited from EventMachine::Connection
Instance Method Summary collapse
Methods inherited from EventMachine::Protocols::LineAndTextProtocol
#initialize, #receive_data, #set_binary_mode, #unbind
Methods inherited from EventMachine::Connection
#associate_callback_target, #close_connection, #close_connection_after_writing, #comm_inactivity_timeout, #comm_inactivity_timeout=, #connection_completed, #detach, #error?, #get_outbound_data_size, #get_peer_cert, #get_peername, #get_pid, #get_sock_opt, #get_sockname, #get_status, #initialize, new, #notify_readable=, #notify_readable?, #notify_writable=, #notify_writable?, #pause, #paused?, #pending_connect_timeout, #pending_connect_timeout=, #proxy_incoming_to, #proxy_target_unbound, #receive_data, #reconnect, #resume, #send_data, #send_datagram, #send_file_data, #set_comm_inactivity_timeout, #set_pending_connect_timeout, #ssl_handshake_completed, #ssl_verify_peer, #start_tls, #stop_proxying, #stream_file_data, #unbind
Constructor Details
This class inherits a constructor from EventMachine::Protocols::LineAndTextProtocol
Instance Method Details
#post_init ⇒ Object
146 147 |
# File 'lib/ext/eventmachine-0.12.10/tests/test_ltp.rb', line 146 def post_init end |
#receive_binary_data(text) ⇒ Object
155 156 157 158 |
# File 'lib/ext/eventmachine-0.12.10/tests/test_ltp.rb', line 155 def receive_binary_data text send_data "received #{text.length} bytes" close_connection_after_writing end |
#receive_line(line) ⇒ Object
148 149 150 151 152 153 154 |
# File 'lib/ext/eventmachine-0.12.10/tests/test_ltp.rb', line 148 def receive_line line if line =~ /content-length:\s*(\d+)/i set_binary_mode $1.to_i else raise "protocol error" end end |