ionian 0.6.6 → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/doc/Ionian/Extension/IO.html +70 -65
- data/doc/Ionian/Extension/Socket.html +168 -157
- data/doc/Ionian/Extension.html +1 -1
- data/doc/Ionian/Server.html +47 -51
- data/doc/Ionian/Socket.html +86 -70
- data/doc/Ionian.html +1 -1
- data/doc/_index.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/file.license.html +1 -1
- data/doc/index.html +1 -1
- data/doc/top-level-namespace.html +1 -1
- data/lib/ionian/extension/io.rb +8 -3
- data/lib/ionian/extension/socket.rb +9 -3
- data/lib/ionian/server.rb +15 -14
- data/lib/ionian/socket.rb +23 -14
- metadata +2 -2
data/doc/Ionian/Extension.html
CHANGED
@@ -119,7 +119,7 @@
|
|
119
119
|
</div>
|
120
120
|
|
121
121
|
<div id="footer">
|
122
|
-
Generated on
|
122
|
+
Generated on Sun Apr 13 09:26:35 2014 by
|
123
123
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
124
124
|
0.8.7.4 (ruby-2.1.1).
|
125
125
|
</div>
|
data/doc/Ionian/Server.html
CHANGED
@@ -412,9 +412,6 @@ protocol: :tcp, :unix. Default is :tcp.</code></pre>
|
|
412
412
|
<pre class="lines">
|
413
413
|
|
414
414
|
|
415
|
-
32
|
416
|
-
33
|
417
|
-
34
|
418
415
|
35
|
419
416
|
36
|
420
417
|
37
|
@@ -459,10 +456,12 @@ protocol: :tcp, :unix. Default is :tcp.</code></pre>
|
|
459
456
|
76
|
460
457
|
77
|
461
458
|
78
|
462
|
-
79
|
459
|
+
79
|
460
|
+
80
|
461
|
+
81</pre>
|
463
462
|
</td>
|
464
463
|
<td>
|
465
|
-
<pre class="code"><span class="info file"># File 'lib/ionian/server.rb', line
|
464
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/server.rb', line 35</span>
|
466
465
|
|
467
466
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
468
467
|
<span class='ivar'>@accept_listeners</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
@@ -494,8 +493,7 @@ protocol: :tcp, :unix. Default is :tcp.</code></pre>
|
|
494
493
|
<span class='ivar'>@interface</span> <span class='op'>=</span> <span class='id identifier rubyid_host_port_ary'>host_port_ary</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
|
495
494
|
<span class='ivar'>@port</span> <span class='op'>||=</span> <span class='id identifier rubyid_host_port_ary'>host_port_ary</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
|
496
495
|
|
497
|
-
<span class='
|
498
|
-
</span> <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Port not specified.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='ivar'>@port</span>
|
496
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Port not specified.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='ivar'>@port</span>
|
499
497
|
<span class='ivar'>@port</span> <span class='op'>=</span> <span class='ivar'>@port</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
|
500
498
|
|
501
499
|
<span class='ivar'>@server</span> <span class='op'>=</span> <span class='const'>TCPServer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='ivar'>@interface</span><span class='comma'>,</span> <span class='ivar'>@port</span>
|
@@ -550,12 +548,12 @@ protocol: :tcp, :unix. Default is :tcp.</code></pre>
|
|
550
548
|
<pre class="lines">
|
551
549
|
|
552
550
|
|
553
|
-
|
554
|
-
|
555
|
-
|
551
|
+
13
|
552
|
+
14
|
553
|
+
15</pre>
|
556
554
|
</td>
|
557
555
|
<td>
|
558
|
-
<pre class="code"><span class="info file"># File 'lib/ionian/server.rb', line
|
556
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/server.rb', line 13</span>
|
559
557
|
|
560
558
|
<span class='kw'>def</span> <span class='id identifier rubyid_interface'>interface</span>
|
561
559
|
<span class='ivar'>@interface</span>
|
@@ -593,12 +591,12 @@ protocol: :tcp, :unix. Default is :tcp.</code></pre>
|
|
593
591
|
<pre class="lines">
|
594
592
|
|
595
593
|
|
596
|
-
|
597
|
-
|
598
|
-
|
594
|
+
16
|
595
|
+
17
|
596
|
+
18</pre>
|
599
597
|
</td>
|
600
598
|
<td>
|
601
|
-
<pre class="code"><span class="info file"># File 'lib/ionian/server.rb', line
|
599
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/server.rb', line 16</span>
|
602
600
|
|
603
601
|
<span class='kw'>def</span> <span class='id identifier rubyid_port'>port</span>
|
604
602
|
<span class='ivar'>@port</span>
|
@@ -641,12 +639,12 @@ protocol: :tcp, :unix. Default is :tcp.</code></pre>
|
|
641
639
|
<pre class="lines">
|
642
640
|
|
643
641
|
|
644
|
-
|
645
|
-
|
646
|
-
|
642
|
+
20
|
643
|
+
21
|
644
|
+
22</pre>
|
647
645
|
</td>
|
648
646
|
<td>
|
649
|
-
<pre class="code"><span class="info file"># File 'lib/ionian/server.rb', line
|
647
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/server.rb', line 20</span>
|
650
648
|
|
651
649
|
<span class='kw'>def</span> <span class='id identifier rubyid_protocol'>protocol</span>
|
652
650
|
<span class='ivar'>@protocol</span>
|
@@ -689,18 +687,18 @@ protocol: :tcp, :unix. Default is :tcp.</code></pre>
|
|
689
687
|
<pre class="lines">
|
690
688
|
|
691
689
|
|
692
|
-
106
|
693
690
|
107
|
694
691
|
108
|
695
692
|
109
|
696
|
-
110
|
693
|
+
110
|
694
|
+
111</pre>
|
697
695
|
</td>
|
698
696
|
<td>
|
699
|
-
<pre class="code"><span class="info file"># File 'lib/ionian/server.rb', line
|
697
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/server.rb', line 107</span>
|
700
698
|
|
701
699
|
<span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
|
702
700
|
<span class='ivar'>@server</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span> <span class='kw'>if</span> <span class='ivar'>@server</span>
|
703
|
-
<span class='ivar'>@accept_thread</span><span class='period'>.</span><span class='id identifier
|
701
|
+
<span class='ivar'>@accept_thread</span><span class='period'>.</span><span class='id identifier rubyid_kill'>kill</span> <span class='kw'>if</span> <span class='ivar'>@accept_thread</span>
|
704
702
|
<span class='ivar'>@accept_thread</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
705
703
|
<span class='kw'>end</span></pre>
|
706
704
|
</td>
|
@@ -747,12 +745,12 @@ protocol: :tcp, :unix. Default is :tcp.</code></pre>
|
|
747
745
|
<pre class="lines">
|
748
746
|
|
749
747
|
|
750
|
-
113
|
751
748
|
114
|
752
|
-
115
|
749
|
+
115
|
750
|
+
116</pre>
|
753
751
|
</td>
|
754
752
|
<td>
|
755
|
-
<pre class="code"><span class="info file"># File 'lib/ionian/server.rb', line
|
753
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/server.rb', line 114</span>
|
756
754
|
|
757
755
|
<span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
|
758
756
|
<span class='ivar'>@server</span><span class='period'>.</span><span class='id identifier rubyid_closed?'>closed?</span>
|
@@ -789,8 +787,6 @@ protocol: :tcp, :unix. Default is :tcp.</code></pre>
|
|
789
787
|
<pre class="lines">
|
790
788
|
|
791
789
|
|
792
|
-
84
|
793
|
-
85
|
794
790
|
86
|
795
791
|
87
|
796
792
|
88
|
@@ -808,29 +804,29 @@ protocol: :tcp, :unix. Default is :tcp.</code></pre>
|
|
808
804
|
100
|
809
805
|
101
|
810
806
|
102
|
811
|
-
103
|
807
|
+
103
|
808
|
+
104</pre>
|
812
809
|
</td>
|
813
810
|
<td>
|
814
|
-
<pre class="code"><span class="info file"># File 'lib/ionian/server.rb', line
|
811
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/server.rb', line 86</span>
|
815
812
|
|
816
813
|
<span class='kw'>def</span> <span class='id identifier rubyid_listen'>listen</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
817
814
|
<span class='id identifier rubyid_register_accept_listener'>register_accept_listener</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span> <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
|
818
815
|
|
819
816
|
<span class='ivar'>@accept_thread</span> <span class='op'>||=</span> <span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>do</span>
|
820
|
-
<span class='
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
<span class='
|
829
|
-
|
830
|
-
</span>
|
831
|
-
<span class='
|
832
|
-
|
833
|
-
</span> <span class='kw'>end</span>
|
817
|
+
<span class='id identifier rubyid_loop'>loop</span> <span class='kw'>do</span>
|
818
|
+
<span class='comment'># Package in an Ionian::Socket
|
819
|
+
</span> <span class='kw'>begin</span>
|
820
|
+
<span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'>Ionian</span><span class='op'>::</span><span class='const'>Socket</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='ivar'>@server</span><span class='period'>.</span><span class='id identifier rubyid_accept'>accept</span>
|
821
|
+
<span class='ivar'>@accept_listeners</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_listener'>listener</span><span class='op'>|</span> <span class='id identifier rubyid_listener'>listener</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span> <span class='id identifier rubyid_client'>client</span> <span class='rbrace'>}</span>
|
822
|
+
<span class='kw'>rescue</span> <span class='const'>Errno</span><span class='op'>::</span><span class='const'>EBADF</span>
|
823
|
+
<span class='comment'># This ignores the connection if the client closed it before it
|
824
|
+
</span> <span class='comment'># could be accepted.
|
825
|
+
</span> <span class='kw'>rescue</span> <span class='const'>IOError</span>
|
826
|
+
<span class='comment'># This ignores the connection if the client closed it before it
|
827
|
+
</span> <span class='comment'># could be accepted.
|
828
|
+
</span> <span class='kw'>end</span>
|
829
|
+
<span class='kw'>end</span>
|
834
830
|
<span class='kw'>end</span>
|
835
831
|
<span class='kw'>end</span></pre>
|
836
832
|
</td>
|
@@ -869,13 +865,13 @@ connected client is passed to the block as an Ionain::Client.</p>
|
|
869
865
|
<pre class="lines">
|
870
866
|
|
871
867
|
|
872
|
-
119
|
873
868
|
120
|
874
869
|
121
|
875
|
-
122
|
870
|
+
122
|
871
|
+
123</pre>
|
876
872
|
</td>
|
877
873
|
<td>
|
878
|
-
<pre class="code"><span class="info file"># File 'lib/ionian/server.rb', line
|
874
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/server.rb', line 120</span>
|
879
875
|
|
880
876
|
<span class='kw'>def</span> <span class='id identifier rubyid_register_accept_listener'>register_accept_listener</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
881
877
|
<span class='ivar'>@accept_listeners</span> <span class='op'><<</span> <span class='id identifier rubyid_block'>block</span> <span class='kw'>unless</span> <span class='ivar'>@accept_listeners</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_block'>block</span>
|
@@ -912,13 +908,13 @@ connected client is passed to the block as an Ionain::Client.</p>
|
|
912
908
|
<pre class="lines">
|
913
909
|
|
914
910
|
|
915
|
-
127
|
916
911
|
128
|
917
912
|
129
|
918
|
-
130
|
913
|
+
130
|
914
|
+
131</pre>
|
919
915
|
</td>
|
920
916
|
<td>
|
921
|
-
<pre class="code"><span class="info file"># File 'lib/ionian/server.rb', line
|
917
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/server.rb', line 128</span>
|
922
918
|
|
923
919
|
<span class='kw'>def</span> <span class='id identifier rubyid_unregister_accept_listener'>unregister_accept_listener</span> <span class='id identifier rubyid_proc'>proc</span>
|
924
920
|
<span class='ivar'>@accept_listeners</span><span class='period'>.</span><span class='id identifier rubyid_delete_if'>delete_if</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_o'>o</span><span class='op'>|</span> <span class='id identifier rubyid_o'>o</span> <span class='op'>==</span> <span class='id identifier rubyid_proc'>proc</span> <span class='rbrace'>}</span>
|
@@ -934,7 +930,7 @@ connected client is passed to the block as an Ionain::Client.</p>
|
|
934
930
|
</div>
|
935
931
|
|
936
932
|
<div id="footer">
|
937
|
-
Generated on
|
933
|
+
Generated on Sun Apr 13 09:26:35 2014 by
|
938
934
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
939
935
|
0.8.7.4 (ruby-2.1.1).
|
940
936
|
</div>
|
data/doc/Ionian/Socket.html
CHANGED
@@ -579,6 +579,8 @@ reuse_addr: Set true to enable the SO_REUSEADDR flag. Allows local address reuse
|
|
579
579
|
no_delay: Set true to enable the TCP_NODELAY flag. Disables Nagle algorithm.
|
580
580
|
cork: Set true to enable the TCP_CORK flag. Buffers multiple writes
|
581
581
|
into one segment.
|
582
|
+
linger: Set true to enable the SO_LINGER flag. When #close is called,
|
583
|
+
waits for the send buffer to empty before closing the socket.
|
582
584
|
expression: Overrides the #read_match regular expression for received data.</code></pre>
|
583
585
|
|
584
586
|
|
@@ -593,8 +595,6 @@ expression: Overrides the #read_match regular expression for received data.</cod
|
|
593
595
|
<pre class="lines">
|
594
596
|
|
595
597
|
|
596
|
-
40
|
597
|
-
41
|
598
598
|
42
|
599
599
|
43
|
600
600
|
44
|
@@ -653,10 +653,18 @@ expression: Overrides the #read_match regular expression for received data.</cod
|
|
653
653
|
97
|
654
654
|
98
|
655
655
|
99
|
656
|
-
100
|
656
|
+
100
|
657
|
+
101
|
658
|
+
102
|
659
|
+
103
|
660
|
+
104
|
661
|
+
105
|
662
|
+
106
|
663
|
+
107
|
664
|
+
108</pre>
|
657
665
|
</td>
|
658
666
|
<td>
|
659
|
-
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line
|
667
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line 42</span>
|
660
668
|
|
661
669
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='id identifier rubyid_existing_socket'>existing_socket</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span>
|
662
670
|
<span class='ivar'>@socket</span> <span class='op'>=</span> <span class='id identifier rubyid_existing_socket'>existing_socket</span>
|
@@ -712,8 +720,14 @@ expression: Overrides the #read_match regular expression for received data.</cod
|
|
712
720
|
<span class='ivar'>@persistent</span> <span class='op'>=</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='ivar'>@protocol</span> <span class='op'>==</span> <span class='symbol'>:udp</span>
|
713
721
|
|
714
722
|
<span class='ivar'>@reuse_addr</span> <span class='op'>=</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:reuse_addr</span><span class='comma'>,</span> <span class='kw'>false</span>
|
715
|
-
<span class='ivar'>@no_delay</span> <span class='op'>=</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:no_delay</span><span class='comma'>,</span> <span class='kw'>false</span>
|
716
723
|
<span class='ivar'>@cork</span> <span class='op'>=</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:cork</span><span class='comma'>,</span> <span class='kw'>false</span>
|
724
|
+
<span class='ivar'>@no_delay</span> <span class='op'>=</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:no_delay</span><span class='comma'>,</span> <span class='ivar'>@persistent</span> <span class='op'>?</span> <span class='kw'>false</span> <span class='op'>:</span> <span class='kw'>true</span>
|
725
|
+
|
726
|
+
<span class='comment'># Default to false for persistent sockets, true for
|
727
|
+
</span> <span class='comment'># nonpersistent sockets. When nonpersistent, the socket
|
728
|
+
</span> <span class='comment'># should remain open to send data in the buffer after
|
729
|
+
</span> <span class='comment'># close is called (typically right after write).
|
730
|
+
</span> <span class='ivar'>@linger</span> <span class='op'>=</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:linger</span><span class='comma'>,</span> <span class='ivar'>@persistent</span> <span class='op'>?</span> <span class='kw'>false</span> <span class='op'>:</span> <span class='kw'>true</span>
|
717
731
|
|
718
732
|
|
719
733
|
<span class='id identifier rubyid_create_socket'>create_socket</span> <span class='kw'>if</span> <span class='ivar'>@persistent</span>
|
@@ -952,13 +966,13 @@ expression: Overrides the #read_match regular expression for received data.</cod
|
|
952
966
|
<pre class="lines">
|
953
967
|
|
954
968
|
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
969
|
+
173
|
970
|
+
174
|
971
|
+
175
|
972
|
+
176</pre>
|
959
973
|
</td>
|
960
974
|
<td>
|
961
|
-
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line
|
975
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line 173</span>
|
962
976
|
|
963
977
|
<span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
|
964
978
|
<span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>unless</span> <span class='ivar'>@socket</span>
|
@@ -996,14 +1010,6 @@ Block yields received match. See Ionian::Extension::IO#read_match.</p>
|
|
996
1010
|
<pre class="lines">
|
997
1011
|
|
998
1012
|
|
999
|
-
122
|
1000
|
-
123
|
1001
|
-
124
|
1002
|
-
125
|
1003
|
-
126
|
1004
|
-
127
|
1005
|
-
128
|
1006
|
-
129
|
1007
1013
|
130
|
1008
1014
|
131
|
1009
1015
|
132
|
@@ -1011,20 +1017,18 @@ Block yields received match. See Ionian::Extension::IO#read_match.</p>
|
|
1011
1017
|
134
|
1012
1018
|
135
|
1013
1019
|
136
|
1014
|
-
137
|
1020
|
+
137
|
1021
|
+
138
|
1022
|
+
139
|
1023
|
+
140</pre>
|
1015
1024
|
</td>
|
1016
1025
|
<td>
|
1017
|
-
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line
|
1026
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line 130</span>
|
1018
1027
|
|
1019
1028
|
<span class='kw'>def</span> <span class='id identifier rubyid_cmd'>cmd</span> <span class='id identifier rubyid_string'>string</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
1020
1029
|
<span class='id identifier rubyid_create_socket'>create_socket</span> <span class='kw'>unless</span> <span class='ivar'>@persistent</span>
|
1021
1030
|
|
1022
|
-
<span class='
|
1023
|
-
<span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span> <span class='id identifier rubyid_string'>string</span><span class='comma'>,</span> <span class='int'>0</span>
|
1024
|
-
<span class='kw'>else</span>
|
1025
|
-
<span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span> <span class='id identifier rubyid_string'>string</span>
|
1026
|
-
<span class='kw'>end</span>
|
1027
|
-
|
1031
|
+
<span class='id identifier rubyid_write'>write</span> <span class='id identifier rubyid_string'>string</span>
|
1028
1032
|
<span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_flush'>flush</span>
|
1029
1033
|
|
1030
1034
|
<span class='id identifier rubyid_matches'>matches</span> <span class='op'>=</span> <span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_read_match'>read_match</span><span class='lparen'>(</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_match'>match</span><span class='op'>|</span> <span class='kw'>yield</span> <span class='id identifier rubyid_match'>match</span> <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span> <span class='rbrace'>}</span>
|
@@ -1063,12 +1067,12 @@ Block yields received match. See Ionian::Extension::IO#read_match.</p>
|
|
1063
1067
|
<pre class="lines">
|
1064
1068
|
|
1065
1069
|
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1070
|
+
111
|
1071
|
+
112
|
1072
|
+
113</pre>
|
1069
1073
|
</td>
|
1070
1074
|
<td>
|
1071
|
-
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line
|
1075
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line 111</span>
|
1072
1076
|
|
1073
1077
|
<span class='kw'>def</span> <span class='id identifier rubyid_expression'>expression</span>
|
1074
1078
|
<span class='ivar'>@expression</span> <span class='op'>||</span> <span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_expression'>expression</span>
|
@@ -1104,13 +1108,13 @@ Block yields received match. See Ionian::Extension::IO#read_match.</p>
|
|
1104
1108
|
<pre class="lines">
|
1105
1109
|
|
1106
1110
|
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
+
116
|
1112
|
+
117
|
1113
|
+
118
|
1114
|
+
119</pre>
|
1111
1115
|
</td>
|
1112
1116
|
<td>
|
1113
|
-
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line
|
1117
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line 116</span>
|
1114
1118
|
|
1115
1119
|
<span class='kw'>def</span> <span class='id identifier rubyid_expression='>expression=</span> <span class='id identifier rubyid_exp'>exp</span>
|
1116
1120
|
<span class='ivar'>@expression</span> <span class='op'>=</span> <span class='id identifier rubyid_exp'>exp</span>
|
@@ -1148,12 +1152,12 @@ non-persistent sockets.</p>
|
|
1148
1152
|
<pre class="lines">
|
1149
1153
|
|
1150
1154
|
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1155
|
+
180
|
1156
|
+
181
|
1157
|
+
182</pre>
|
1154
1158
|
</td>
|
1155
1159
|
<td>
|
1156
|
-
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line
|
1160
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line 180</span>
|
1157
1161
|
|
1158
1162
|
<span class='kw'>def</span> <span class='id identifier rubyid_flush'>flush</span>
|
1159
1163
|
<span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_flush'>flush</span> <span class='kw'>if</span> <span class='ivar'>@persistent</span>
|
@@ -1205,13 +1209,13 @@ non-persistent sockets.</p>
|
|
1205
1209
|
<pre class="lines">
|
1206
1210
|
|
1207
1211
|
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
+
167
|
1213
|
+
168
|
1214
|
+
169
|
1215
|
+
170</pre>
|
1212
1216
|
</td>
|
1213
1217
|
<td>
|
1214
|
-
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line
|
1218
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line 167</span>
|
1215
1219
|
|
1216
1220
|
<span class='kw'>def</span> <span class='id identifier rubyid_has_data?'>has_data?</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span>
|
1217
1221
|
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='ivar'>@socket</span>
|
@@ -1261,12 +1265,12 @@ non-persistent sockets.</p>
|
|
1261
1265
|
<pre class="lines">
|
1262
1266
|
|
1263
1267
|
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1268
|
+
122
|
1269
|
+
123
|
1270
|
+
124</pre>
|
1267
1271
|
</td>
|
1268
1272
|
<td>
|
1269
|
-
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line
|
1273
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line 122</span>
|
1270
1274
|
|
1271
1275
|
<span class='kw'>def</span> <span class='id identifier rubyid_persistent?'>persistent?</span>
|
1272
1276
|
<span class='ivar'>@persistent</span> <span class='op'>==</span> <span class='kw'>false</span> <span class='op'>||</span> <span class='ivar'>@persistent</span> <span class='op'>==</span> <span class='kw'>nil</span> <span class='op'>?</span> <span class='kw'>false</span> <span class='op'>:</span> <span class='kw'>true</span>
|
@@ -1303,12 +1307,12 @@ any string not already ending with one.</p>
|
|
1303
1307
|
<pre class="lines">
|
1304
1308
|
|
1305
1309
|
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1310
|
+
186
|
1311
|
+
187
|
1312
|
+
188</pre>
|
1309
1313
|
</td>
|
1310
1314
|
<td>
|
1311
|
-
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line
|
1315
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line 186</span>
|
1312
1316
|
|
1313
1317
|
<span class='kw'>def</span> <span class='id identifier rubyid_puts'>puts</span> <span class='op'>*</span><span class='id identifier rubyid_string'>string</span>
|
1314
1318
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span> <span class='id identifier rubyid_string'>string</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_s'>s</span><span class='op'>|</span> <span class='id identifier rubyid_s'>s</span><span class='period'>.</span><span class='id identifier rubyid_chomp'>chomp</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span>
|
@@ -1350,14 +1354,14 @@ reference to the given block. block = ionian_socket.register_observer { … }</p
|
|
1350
1354
|
<pre class="lines">
|
1351
1355
|
|
1352
1356
|
|
1353
|
-
143
|
1354
|
-
144
|
1355
|
-
145
|
1356
1357
|
146
|
1357
|
-
147
|
1358
|
+
147
|
1359
|
+
148
|
1360
|
+
149
|
1361
|
+
150</pre>
|
1358
1362
|
</td>
|
1359
1363
|
<td>
|
1360
|
-
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line
|
1364
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line 146</span>
|
1361
1365
|
|
1362
1366
|
<span class='kw'>def</span> <span class='id identifier rubyid_register_observer'>register_observer</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
1363
1367
|
<span class='ivar'>@ionian_listeners</span> <span class='op'><<</span> <span class='id identifier rubyid_block'>block</span> <span class='kw'>unless</span> <span class='ivar'>@ionian_listeners</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_block'>block</span>
|
@@ -1395,14 +1399,14 @@ reference to the given block. block = ionian_socket.register_observer { … }</p
|
|
1395
1399
|
<pre class="lines">
|
1396
1400
|
|
1397
1401
|
|
1398
|
-
152
|
1399
|
-
153
|
1400
|
-
154
|
1401
1402
|
155
|
1402
|
-
156
|
1403
|
+
156
|
1404
|
+
157
|
1405
|
+
158
|
1406
|
+
159</pre>
|
1403
1407
|
</td>
|
1404
1408
|
<td>
|
1405
|
-
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line
|
1409
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line 155</span>
|
1406
1410
|
|
1407
1411
|
<span class='kw'>def</span> <span class='id identifier rubyid_unregister_observer'>unregister_observer</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
1408
1412
|
<span class='ivar'>@ionian_listeners</span><span class='period'>.</span><span class='id identifier rubyid_delete_if'>delete_if</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_o'>o</span><span class='op'>|</span> <span class='id identifier rubyid_o'>o</span> <span class='op'>==</span> <span class='id identifier rubyid_block'>block</span> <span class='rbrace'>}</span>
|
@@ -1444,9 +1448,6 @@ reference to the given block. block = ionian_socket.register_observer { … }</p
|
|
1444
1448
|
<pre class="lines">
|
1445
1449
|
|
1446
1450
|
|
1447
|
-
189
|
1448
|
-
190
|
1449
|
-
191
|
1450
1451
|
192
|
1451
1452
|
193
|
1452
1453
|
194
|
@@ -1464,10 +1465,19 @@ reference to the given block. block = ionian_socket.register_observer { … }</p
|
|
1464
1465
|
206
|
1465
1466
|
207
|
1466
1467
|
208
|
1467
|
-
209
|
1468
|
+
209
|
1469
|
+
210
|
1470
|
+
211
|
1471
|
+
212
|
1472
|
+
213
|
1473
|
+
214
|
1474
|
+
215
|
1475
|
+
216
|
1476
|
+
217
|
1477
|
+
218</pre>
|
1468
1478
|
</td>
|
1469
1479
|
<td>
|
1470
|
-
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line
|
1480
|
+
<pre class="code"><span class="info file"># File 'lib/ionian/socket.rb', line 192</span>
|
1471
1481
|
|
1472
1482
|
<span class='kw'>def</span> <span class='id identifier rubyid_write'>write</span> <span class='id identifier rubyid_string'>string</span>
|
1473
1483
|
<span class='id identifier rubyid_create_socket'>create_socket</span> <span class='kw'>unless</span> <span class='ivar'>@persistent</span>
|
@@ -1481,10 +1491,16 @@ reference to the given block. block = ionian_socket.register_observer { … }</p
|
|
1481
1491
|
<span class='kw'>end</span>
|
1482
1492
|
|
1483
1493
|
<span class='kw'>unless</span> <span class='ivar'>@persistent</span>
|
1494
|
+
<span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_flush'>flush</span>
|
1495
|
+
|
1484
1496
|
<span class='comment'># Read in data to prevent RST packets.
|
1485
|
-
</span> <span class='
|
1486
|
-
<span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier
|
1497
|
+
</span> <span class='comment'># TODO: Shutdown read stream instead?
|
1498
|
+
</span> <span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_read_all'>read_all</span> <span class='label'>nonblocking:</span> <span class='kw'>true</span>
|
1487
1499
|
|
1500
|
+
<span class='comment'># TODO: Sleep added so that data can be read on the receiving
|
1501
|
+
</span> <span class='comment'># end. Can this be changed to shutdown write?
|
1502
|
+
</span> <span class='comment'># Why isn't so_linger taking care of this?
|
1503
|
+
</span> <span class='id identifier rubyid_sleep'>sleep</span> <span class='float'>0.01</span>
|
1488
1504
|
<span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span>
|
1489
1505
|
<span class='kw'>end</span>
|
1490
1506
|
|
@@ -1500,7 +1516,7 @@ reference to the given block. block = ionian_socket.register_observer { … }</p
|
|
1500
1516
|
</div>
|
1501
1517
|
|
1502
1518
|
<div id="footer">
|
1503
|
-
Generated on
|
1519
|
+
Generated on Sun Apr 13 09:26:35 2014 by
|
1504
1520
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1505
1521
|
0.8.7.4 (ruby-2.1.1).
|
1506
1522
|
</div>
|
data/doc/Ionian.html
CHANGED
@@ -123,7 +123,7 @@ Features regular expression matching and notification of received data.</p>
|
|
123
123
|
</div>
|
124
124
|
|
125
125
|
<div id="footer">
|
126
|
-
Generated on
|
126
|
+
Generated on Sun Apr 13 09:26:35 2014 by
|
127
127
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
128
128
|
0.8.7.4 (ruby-2.1.1).
|
129
129
|
</div>
|
data/doc/_index.html
CHANGED
@@ -155,7 +155,7 @@
|
|
155
155
|
</div>
|
156
156
|
|
157
157
|
<div id="footer">
|
158
|
-
Generated on
|
158
|
+
Generated on Sun Apr 13 09:26:35 2014 by
|
159
159
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
160
160
|
0.8.7.4 (ruby-2.1.1).
|
161
161
|
</div>
|
data/doc/file.README.html
CHANGED
@@ -137,7 +137,7 @@
|
|
137
137
|
</div></div>
|
138
138
|
|
139
139
|
<div id="footer">
|
140
|
-
Generated on
|
140
|
+
Generated on Sun Apr 13 09:26:35 2014 by
|
141
141
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
142
142
|
0.8.7.4 (ruby-2.1.1).
|
143
143
|
</div>
|
data/doc/file.license.html
CHANGED
@@ -64,7 +64,7 @@
|
|
64
64
|
<div id="content"><div id='filecontents'>The MIT License (MIT)<br/><br/>Copyright (c) 2013 Alex McLain<br/><br/>Permission is hereby granted, free of charge, to any person obtaining a copy<br/>of this software and associated documentation files (the "Software"), to deal<br/>in the Software without restriction, including without limitation the rights<br/>to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br/>copies of the Software, and to permit persons to whom the Software is<br/>furnished to do so, subject to the following conditions:<br/><br/>The above copyright notice and this permission notice shall be included in<br/>all copies or substantial portions of the Software.<br/><br/>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br/>IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br/>FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br/>AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br/>LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br/>OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br/>THE SOFTWARE.
|
65
65
|
|
66
66
|
<div id="footer">
|
67
|
-
Generated on
|
67
|
+
Generated on Sun Apr 13 09:26:35 2014 by
|
68
68
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
69
69
|
0.8.7.4 (ruby-2.1.1).
|
70
70
|
</div>
|
data/doc/index.html
CHANGED
@@ -137,7 +137,7 @@
|
|
137
137
|
</div></div>
|
138
138
|
|
139
139
|
<div id="footer">
|
140
|
-
Generated on
|
140
|
+
Generated on Sun Apr 13 09:26:35 2014 by
|
141
141
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
142
142
|
0.8.7.4 (ruby-2.1.1).
|
143
143
|
</div>
|