eventmachine 0.12.8-x86-mswin32-60 → 0.12.10-x86-mswin32-60

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. data/.gitignore +14 -13
  2. data/Rakefile +374 -264
  3. data/eventmachine.gemspec +4 -5
  4. data/ext/binder.cpp +125 -126
  5. data/ext/binder.h +46 -48
  6. data/ext/cmain.cpp +184 -42
  7. data/ext/cplusplus.cpp +202 -202
  8. data/ext/ed.cpp +242 -81
  9. data/ext/ed.h +39 -22
  10. data/ext/em.cpp +127 -108
  11. data/ext/em.h +27 -18
  12. data/ext/emwin.cpp +3 -3
  13. data/ext/eventmachine.h +49 -38
  14. data/ext/eventmachine_cpp.h +96 -96
  15. data/ext/extconf.rb +147 -132
  16. data/ext/fastfilereader/extconf.rb +82 -76
  17. data/ext/project.h +151 -140
  18. data/ext/rubymain.cpp +222 -103
  19. data/ext/ssl.cpp +460 -460
  20. data/ext/ssl.h +94 -94
  21. data/java/src/com/rubyeventmachine/EmReactor.java +570 -423
  22. data/java/src/com/rubyeventmachine/EventableChannel.java +69 -57
  23. data/java/src/com/rubyeventmachine/EventableDatagramChannel.java +189 -171
  24. data/java/src/com/rubyeventmachine/EventableSocketChannel.java +364 -244
  25. data/java/src/com/rubyeventmachine/{Application.java → application/Application.java} +194 -200
  26. data/java/src/com/rubyeventmachine/{Connection.java → application/Connection.java} +74 -74
  27. data/java/src/com/rubyeventmachine/{ConnectionFactory.java → application/ConnectionFactory.java} +36 -36
  28. data/java/src/com/rubyeventmachine/{DefaultConnectionFactory.java → application/DefaultConnectionFactory.java} +46 -46
  29. data/java/src/com/rubyeventmachine/{PeriodicTimer.java → application/PeriodicTimer.java} +38 -38
  30. data/java/src/com/rubyeventmachine/{Timer.java → application/Timer.java} +54 -54
  31. data/java/src/com/rubyeventmachine/tests/ApplicationTest.java +109 -108
  32. data/java/src/com/rubyeventmachine/tests/ConnectTest.java +148 -146
  33. data/java/src/com/rubyeventmachine/tests/TestDatagrams.java +53 -53
  34. data/java/src/com/rubyeventmachine/tests/TestServers.java +75 -74
  35. data/java/src/com/rubyeventmachine/tests/TestTimers.java +90 -89
  36. data/lib/em/connection.rb +71 -12
  37. data/lib/em/deferrable.rb +191 -186
  38. data/lib/em/protocols.rb +36 -35
  39. data/lib/em/protocols/httpclient2.rb +590 -582
  40. data/lib/em/protocols/line_and_text.rb +125 -126
  41. data/lib/em/protocols/linetext2.rb +161 -160
  42. data/lib/em/protocols/object_protocol.rb +45 -39
  43. data/lib/em/protocols/smtpclient.rb +357 -331
  44. data/lib/em/protocols/socks4.rb +66 -0
  45. data/lib/em/queue.rb +60 -60
  46. data/lib/em/timers.rb +56 -55
  47. data/lib/em/version.rb +1 -1
  48. data/lib/eventmachine.rb +125 -169
  49. data/lib/jeventmachine.rb +257 -142
  50. data/tasks/{cpp.rake → cpp.rake_example} +76 -76
  51. data/tests/test_attach.rb +125 -100
  52. data/tests/test_basic.rb +1 -2
  53. data/tests/test_connection_count.rb +34 -44
  54. data/tests/test_epoll.rb +0 -2
  55. data/tests/test_get_sock_opt.rb +30 -0
  56. data/tests/test_httpclient2.rb +3 -3
  57. data/tests/test_inactivity_timeout.rb +21 -1
  58. data/tests/test_ltp.rb +182 -188
  59. data/tests/test_next_tick.rb +0 -2
  60. data/tests/test_pause.rb +70 -0
  61. data/tests/test_pending_connect_timeout.rb +48 -0
  62. data/tests/test_ssl_args.rb +78 -67
  63. data/tests/test_timers.rb +162 -141
  64. metadata +13 -11
  65. data/tasks/project.rake +0 -79
  66. data/tasks/tests.rake +0 -193
@@ -1,126 +1,125 @@
1
- #--
2
- #
3
- # Author:: Francis Cianfrocca (gmail: blackhedd)
4
- # Homepage:: http://rubyeventmachine.com
5
- # Date:: 15 November 2006
6
- #
7
- # See EventMachine and EventMachine::Connection for documentation and
8
- # usage examples.
9
- #
10
- #----------------------------------------------------------------------------
11
- #
12
- # Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved.
13
- # Gmail: blackhedd
14
- #
15
- # This program is free software; you can redistribute it and/or modify
16
- # it under the terms of either: 1) the GNU General Public License
17
- # as published by the Free Software Foundation; either version 2 of the
18
- # License, or (at your option) any later version; or 2) Ruby's License.
19
- #
20
- # See the file COPYING for complete licensing information.
21
- #
22
- #---------------------------------------------------------------------------
23
- #
24
- #
25
- #
26
- require File.dirname(__FILE__) + '/../buftok'
27
-
28
- module EventMachine
29
- module Protocols
30
- # A protocol that handles line-oriented data with interspersed binary text.
31
- #
32
- # This version is optimized for performance. See EventMachine::Protocols::LineText2
33
- # for a version which is optimized for correctness with regard to binary text blocks
34
- # that can switch back to line mode.
35
- class LineAndTextProtocol < Connection
36
- MaxLineLength = 16*1024
37
- MaxBinaryLength = 32*1024*1024
38
-
39
- def initialize *args
40
- super
41
- lbp_init_line_state
42
- end
43
- def receive_data data
44
- if @lbp_mode == :lines
45
- begin
46
- @lpb_buffer.extract(data).each do |line|
47
- receive_line(line.chomp) if respond_to?(:receive_line)
48
- end
49
- rescue Exception
50
- receive_error('overlength line') if respond_to?(:receive_error)
51
- close_connection
52
- return
53
- end
54
- else
55
- if @lbp_binary_limit > 0
56
- wanted = @lbp_binary_limit - @lbp_binary_bytes_received
57
- chunk = nil
58
- if data.length > wanted
59
- chunk = data.slice!(0...wanted)
60
- else
61
- chunk = data
62
- data = ""
63
- end
64
- @lbp_binary_buffer[@lbp_binary_bytes_received...(@lbp_binary_bytes_received+chunk.length)] = chunk
65
- @lbp_binary_bytes_received += chunk.length
66
- if @lbp_binary_bytes_received == @lbp_binary_limit
67
- receive_binary_data(@lbp_binary_buffer) if respond_to?(:receive_binary_data)
68
- lbp_init_line_state
69
- end
70
- receive_data(data) if data.length > 0
71
- else
72
- receive_binary_data(data) if respond_to?(:receive_binary_data)
73
- data = ""
74
- end
75
- end
76
- end
77
-
78
- def unbind
79
- if @lbp_mode == :binary and @lbp_binary_limit > 0
80
- if respond_to?(:receive_binary_data)
81
- receive_binary_data( @lbp_binary_buffer[0...@lbp_binary_bytes_received] )
82
- end
83
- end
84
- end
85
-
86
- # Set up to read the supplied number of binary bytes.
87
- # This recycles all the data currently waiting in the line buffer, if any.
88
- # If the limit is nil, then ALL subsequent data will be treated as binary
89
- # data and passed to the upstream protocol handler as we receive it.
90
- # If a limit is given, we'll hold the incoming binary data and not
91
- # pass it upstream until we've seen it all, or until there is an unbind
92
- # (in which case we'll pass up a partial).
93
- # Specifying nil for the limit (the default) means there is no limit.
94
- # Specifiyng zero for the limit will cause an immediate transition back to line mode.
95
- #
96
- def set_binary_mode size = nil
97
- if @lbp_mode == :lines
98
- if size == 0
99
- receive_binary_data("") if respond_to?(:receive_binary_data)
100
- # Do no more work here. Stay in line mode and keep consuming data.
101
- else
102
- @lbp_binary_limit = size.to_i # (nil will be stored as zero)
103
- if @lbp_binary_limit > 0
104
- raise "Overlength" if @lbp_binary_limit > MaxBinaryLength # arbitrary sanity check
105
- @lbp_binary_buffer = "\0" * @lbp_binary_limit
106
- @lbp_binary_bytes_received = 0
107
- end
108
-
109
- @lbp_mode = :binary
110
- receive_data @lpb_buffer.flush
111
- end
112
- else
113
- raise "invalid operation"
114
- end
115
- end
116
-
117
- #--
118
- # For internal use, establish protocol baseline for handling lines.
119
- def lbp_init_line_state
120
- @lpb_buffer = BufferedTokenizer.new("\n", MaxLineLength)
121
- @lbp_mode = :lines
122
- end
123
- private :lbp_init_line_state
124
- end
125
- end
126
- end
1
+ #--
2
+ #
3
+ # Author:: Francis Cianfrocca (gmail: blackhedd)
4
+ # Homepage:: http://rubyeventmachine.com
5
+ # Date:: 15 November 2006
6
+ #
7
+ # See EventMachine and EventMachine::Connection for documentation and
8
+ # usage examples.
9
+ #
10
+ #----------------------------------------------------------------------------
11
+ #
12
+ # Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved.
13
+ # Gmail: blackhedd
14
+ #
15
+ # This program is free software; you can redistribute it and/or modify
16
+ # it under the terms of either: 1) the GNU General Public License
17
+ # as published by the Free Software Foundation; either version 2 of the
18
+ # License, or (at your option) any later version; or 2) Ruby's License.
19
+ #
20
+ # See the file COPYING for complete licensing information.
21
+ #
22
+ #---------------------------------------------------------------------------
23
+ #
24
+ #
25
+ #
26
+
27
+ module EventMachine
28
+ module Protocols
29
+ # A protocol that handles line-oriented data with interspersed binary text.
30
+ #
31
+ # This version is optimized for performance. See EventMachine::Protocols::LineText2
32
+ # for a version which is optimized for correctness with regard to binary text blocks
33
+ # that can switch back to line mode.
34
+ class LineAndTextProtocol < Connection
35
+ MaxLineLength = 16*1024
36
+ MaxBinaryLength = 32*1024*1024
37
+
38
+ def initialize *args
39
+ super
40
+ lbp_init_line_state
41
+ end
42
+ def receive_data data
43
+ if @lbp_mode == :lines
44
+ begin
45
+ @lpb_buffer.extract(data).each do |line|
46
+ receive_line(line.chomp) if respond_to?(:receive_line)
47
+ end
48
+ rescue Exception
49
+ receive_error('overlength line') if respond_to?(:receive_error)
50
+ close_connection
51
+ return
52
+ end
53
+ else
54
+ if @lbp_binary_limit > 0
55
+ wanted = @lbp_binary_limit - @lbp_binary_bytes_received
56
+ chunk = nil
57
+ if data.length > wanted
58
+ chunk = data.slice!(0...wanted)
59
+ else
60
+ chunk = data
61
+ data = ""
62
+ end
63
+ @lbp_binary_buffer[@lbp_binary_bytes_received...(@lbp_binary_bytes_received+chunk.length)] = chunk
64
+ @lbp_binary_bytes_received += chunk.length
65
+ if @lbp_binary_bytes_received == @lbp_binary_limit
66
+ receive_binary_data(@lbp_binary_buffer) if respond_to?(:receive_binary_data)
67
+ lbp_init_line_state
68
+ end
69
+ receive_data(data) if data.length > 0
70
+ else
71
+ receive_binary_data(data) if respond_to?(:receive_binary_data)
72
+ data = ""
73
+ end
74
+ end
75
+ end
76
+
77
+ def unbind
78
+ if @lbp_mode == :binary and @lbp_binary_limit > 0
79
+ if respond_to?(:receive_binary_data)
80
+ receive_binary_data( @lbp_binary_buffer[0...@lbp_binary_bytes_received] )
81
+ end
82
+ end
83
+ end
84
+
85
+ # Set up to read the supplied number of binary bytes.
86
+ # This recycles all the data currently waiting in the line buffer, if any.
87
+ # If the limit is nil, then ALL subsequent data will be treated as binary
88
+ # data and passed to the upstream protocol handler as we receive it.
89
+ # If a limit is given, we'll hold the incoming binary data and not
90
+ # pass it upstream until we've seen it all, or until there is an unbind
91
+ # (in which case we'll pass up a partial).
92
+ # Specifying nil for the limit (the default) means there is no limit.
93
+ # Specifiyng zero for the limit will cause an immediate transition back to line mode.
94
+ #
95
+ def set_binary_mode size = nil
96
+ if @lbp_mode == :lines
97
+ if size == 0
98
+ receive_binary_data("") if respond_to?(:receive_binary_data)
99
+ # Do no more work here. Stay in line mode and keep consuming data.
100
+ else
101
+ @lbp_binary_limit = size.to_i # (nil will be stored as zero)
102
+ if @lbp_binary_limit > 0
103
+ raise "Overlength" if @lbp_binary_limit > MaxBinaryLength # arbitrary sanity check
104
+ @lbp_binary_buffer = "\0" * @lbp_binary_limit
105
+ @lbp_binary_bytes_received = 0
106
+ end
107
+
108
+ @lbp_mode = :binary
109
+ receive_data @lpb_buffer.flush
110
+ end
111
+ else
112
+ raise "invalid operation"
113
+ end
114
+ end
115
+
116
+ #--
117
+ # For internal use, establish protocol baseline for handling lines.
118
+ def lbp_init_line_state
119
+ @lpb_buffer = BufferedTokenizer.new("\n", MaxLineLength)
120
+ @lbp_mode = :lines
121
+ end
122
+ private :lbp_init_line_state
123
+ end
124
+ end
125
+ end
@@ -1,160 +1,161 @@
1
- #--
2
- #
3
- # Author:: Francis Cianfrocca (gmail: blackhedd)
4
- # Homepage:: http://rubyeventmachine.com
5
- # Date:: 15 November 2006
6
- #
7
- # See EventMachine and EventMachine::Connection for documentation and
8
- # usage examples.
9
- #
10
- #----------------------------------------------------------------------------
11
- #
12
- # Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved.
13
- # Gmail: blackhedd
14
- #
15
- # This program is free software; you can redistribute it and/or modify
16
- # it under the terms of either: 1) the GNU General Public License
17
- # as published by the Free Software Foundation; either version 2 of the
18
- # License, or (at your option) any later version; or 2) Ruby's License.
19
- #
20
- # See the file COPYING for complete licensing information.
21
- #
22
- #---------------------------------------------------------------------------
23
- #
24
- #
25
-
26
- module EventMachine
27
- module Protocols
28
- # In the grand, time-honored tradition of re-inventing the wheel, we offer
29
- # here YET ANOTHER protocol that handles line-oriented data with interspersed
30
- # binary text. This one trades away some of the performance optimizations of
31
- # EventMachine::Protocols::LineAndTextProtocol in order to get better correctness
32
- # with regard to binary text blocks that can switch back to line mode. It also
33
- # permits the line-delimiter to change in midstream.
34
- # This was originally written to support Stomp.
35
- module LineText2
36
- # TODO! We're not enforcing the limits on header lengths and text-lengths.
37
- # When we get around to that, call #receive_error if the user defined it, otherwise
38
- # throw exceptions.
39
-
40
- MaxLineLength = 16*1024
41
- MaxBinaryLength = 32*1024*1024
42
-
43
- #--
44
- # Will be called recursively until there's no data to read.
45
- # That way the user-defined handlers we call can modify the
46
- # handling characteristics on a per-token basis.
47
- #
48
- def receive_data data
49
- return unless (data and data.length > 0)
50
-
51
- # Do this stuff in lieu of a constructor.
52
- @lt2_mode ||= :lines
53
- @lt2_delimiter ||= "\n"
54
- @lt2_linebuffer ||= []
55
-
56
- if @lt2_mode == :lines
57
- if ix = data.index( @lt2_delimiter )
58
- @lt2_linebuffer << data[0...ix]
59
- ln = @lt2_linebuffer.join
60
- @lt2_linebuffer.clear
61
- if @lt2_delimiter == "\n"
62
- ln.chomp!
63
- end
64
- receive_line ln
65
- receive_data data[(ix+@lt2_delimiter.length)..-1]
66
- else
67
- @lt2_linebuffer << data
68
- end
69
- elsif @lt2_mode == :text
70
- if @lt2_textsize
71
- needed = @lt2_textsize - @lt2_textpos
72
- will_take = if data.length > needed
73
- needed
74
- else
75
- data.length
76
- end
77
-
78
- @lt2_textbuffer << data[0...will_take]
79
- tail = data[will_take..-1]
80
-
81
- @lt2_textpos += will_take
82
- if @lt2_textpos >= @lt2_textsize
83
- # Reset line mode (the default behavior) BEFORE calling the
84
- # receive_binary_data. This makes it possible for user code
85
- # to call set_text_mode, enabling chains of text blocks
86
- # (which can possibly be of different sizes).
87
- set_line_mode
88
- receive_binary_data @lt2_textbuffer.join
89
- receive_end_of_binary_data
90
- end
91
-
92
- receive_data tail
93
- else
94
- receive_binary_data data
95
- end
96
- end
97
- end
98
-
99
-
100
- def set_delimiter delim
101
- @lt2_delimiter = delim.to_s
102
- end
103
-
104
- # Called internally but also exposed to user code, for the case in which
105
- # processing of binary data creates a need to transition back to line mode.
106
- # We support an optional parameter to "throw back" some data, which might
107
- # be an umprocessed chunk of the transmitted binary data, or something else
108
- # entirely.
109
- def set_line_mode data=""
110
- @lt2_mode = :lines
111
- (@lt2_linebuffer ||= []).clear
112
- receive_data data.to_s
113
- end
114
-
115
- def set_text_mode size=nil
116
- if size == 0
117
- set_line_mode
118
- else
119
- @lt2_mode = :text
120
- (@lt2_textbuffer ||= []).clear
121
- @lt2_textsize = size # which can be nil, signifying no limit
122
- @lt2_textpos = 0
123
- end
124
- end
125
-
126
- # Alias for #set_text_mode, added for back-compatibility with LineAndTextProtocol.
127
- def set_binary_mode size=nil
128
- set_text_mode size
129
- end
130
-
131
- # In case of a dropped connection, we'll send a partial buffer to user code
132
- # when in sized text mode. User overrides of #receive_binary_data need to
133
- # be aware that they may get a short buffer.
134
- def unbind
135
- if @lt2_mode == :text and @lt2_textpos > 0
136
- receive_binary_data @lt2_textbuffer.join
137
- end
138
- end
139
-
140
- # Stub. Should be subclassed by user code.
141
- def receive_line ln
142
- # no-op
143
- end
144
-
145
- # Stub. Should be subclassed by user code.
146
- def receive_binary_data data
147
- # no-op
148
- end
149
-
150
- # Stub. Should be subclassed by user code.
151
- # This is called when transitioning internally from text mode
152
- # back to line mode. Useful when client code doesn't want
153
- # to keep track of how much data it's received.
154
- def receive_end_of_binary_data
155
- # no-op
156
- end
157
- end
158
- end
159
- end
160
-
1
+ #--
2
+ #
3
+ # Author:: Francis Cianfrocca (gmail: blackhedd)
4
+ # Homepage:: http://rubyeventmachine.com
5
+ # Date:: 15 November 2006
6
+ #
7
+ # See EventMachine and EventMachine::Connection for documentation and
8
+ # usage examples.
9
+ #
10
+ #----------------------------------------------------------------------------
11
+ #
12
+ # Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved.
13
+ # Gmail: blackhedd
14
+ #
15
+ # This program is free software; you can redistribute it and/or modify
16
+ # it under the terms of either: 1) the GNU General Public License
17
+ # as published by the Free Software Foundation; either version 2 of the
18
+ # License, or (at your option) any later version; or 2) Ruby's License.
19
+ #
20
+ # See the file COPYING for complete licensing information.
21
+ #
22
+ #---------------------------------------------------------------------------
23
+ #
24
+ #
25
+
26
+ module EventMachine
27
+ module Protocols
28
+ # In the grand, time-honored tradition of re-inventing the wheel, we offer
29
+ # here YET ANOTHER protocol that handles line-oriented data with interspersed
30
+ # binary text. This one trades away some of the performance optimizations of
31
+ # EventMachine::Protocols::LineAndTextProtocol in order to get better correctness
32
+ # with regard to binary text blocks that can switch back to line mode. It also
33
+ # permits the line-delimiter to change in midstream.
34
+ # This was originally written to support Stomp.
35
+ module LineText2
36
+ # TODO! We're not enforcing the limits on header lengths and text-lengths.
37
+ # When we get around to that, call #receive_error if the user defined it, otherwise
38
+ # throw exceptions.
39
+
40
+ MaxLineLength = 16*1024
41
+ MaxBinaryLength = 32*1024*1024
42
+
43
+ #--
44
+ # Will be called recursively until there's no data to read.
45
+ # That way the user-defined handlers we call can modify the
46
+ # handling characteristics on a per-token basis.
47
+ #
48
+ def receive_data data
49
+ return unless (data and data.length > 0)
50
+
51
+ # Do this stuff in lieu of a constructor.
52
+ @lt2_mode ||= :lines
53
+ @lt2_delimiter ||= "\n"
54
+ @lt2_linebuffer ||= []
55
+
56
+ if @lt2_mode == :lines
57
+ if ix = data.index( @lt2_delimiter )
58
+ @lt2_linebuffer << data[0...ix]
59
+ ln = @lt2_linebuffer.join
60
+ @lt2_linebuffer.clear
61
+ if @lt2_delimiter == "\n"
62
+ ln.chomp!
63
+ end
64
+ receive_line ln
65
+ receive_data data[(ix+@lt2_delimiter.length)..-1]
66
+ else
67
+ @lt2_linebuffer << data
68
+ end
69
+ elsif @lt2_mode == :text
70
+ if @lt2_textsize
71
+ needed = @lt2_textsize - @lt2_textpos
72
+ will_take = if data.length > needed
73
+ needed
74
+ else
75
+ data.length
76
+ end
77
+
78
+ @lt2_textbuffer << data[0...will_take]
79
+ tail = data[will_take..-1]
80
+
81
+ @lt2_textpos += will_take
82
+ if @lt2_textpos >= @lt2_textsize
83
+ # Reset line mode (the default behavior) BEFORE calling the
84
+ # receive_binary_data. This makes it possible for user code
85
+ # to call set_text_mode, enabling chains of text blocks
86
+ # (which can possibly be of different sizes).
87
+ set_line_mode
88
+ receive_binary_data @lt2_textbuffer.join
89
+ receive_end_of_binary_data
90
+ end
91
+
92
+ receive_data tail
93
+ else
94
+ receive_binary_data data
95
+ end
96
+ end
97
+ end
98
+
99
+
100
+ def set_delimiter delim
101
+ @lt2_delimiter = delim.to_s
102
+ end
103
+
104
+ # Called internally but also exposed to user code, for the case in which
105
+ # processing of binary data creates a need to transition back to line mode.
106
+ # We support an optional parameter to "throw back" some data, which might
107
+ # be an umprocessed chunk of the transmitted binary data, or something else
108
+ # entirely.
109
+ def set_line_mode data=""
110
+ @lt2_mode = :lines
111
+ (@lt2_linebuffer ||= []).clear
112
+ receive_data data.to_s
113
+ end
114
+
115
+ def set_text_mode size=nil
116
+ if size == 0
117
+ set_line_mode
118
+ else
119
+ @lt2_mode = :text
120
+ (@lt2_textbuffer ||= []).clear
121
+ @lt2_textsize = size # which can be nil, signifying no limit
122
+ @lt2_textpos = 0
123
+ end
124
+ end
125
+
126
+ # Alias for #set_text_mode, added for back-compatibility with LineAndTextProtocol.
127
+ def set_binary_mode size=nil
128
+ set_text_mode size
129
+ end
130
+
131
+ # In case of a dropped connection, we'll send a partial buffer to user code
132
+ # when in sized text mode. User overrides of #receive_binary_data need to
133
+ # be aware that they may get a short buffer.
134
+ def unbind
135
+ @lt2_mode ||= nil
136
+ if @lt2_mode == :text and @lt2_textpos > 0
137
+ receive_binary_data @lt2_textbuffer.join
138
+ end
139
+ end
140
+
141
+ # Stub. Should be subclassed by user code.
142
+ def receive_line ln
143
+ # no-op
144
+ end
145
+
146
+ # Stub. Should be subclassed by user code.
147
+ def receive_binary_data data
148
+ # no-op
149
+ end
150
+
151
+ # Stub. Should be subclassed by user code.
152
+ # This is called when transitioning internally from text mode
153
+ # back to line mode. Useful when client code doesn't want
154
+ # to keep track of how much data it's received.
155
+ def receive_end_of_binary_data
156
+ # no-op
157
+ end
158
+ end
159
+ end
160
+ end
161
+