ionian 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c7b4d5f4fb4ff7174af237621df9f0c12c3b17e
4
- data.tar.gz: 44c91a89ce08e4892c1e7c9f69380eb2ded9e468
3
+ metadata.gz: a0202d93f529470e60e92b50e01f597ccab404c4
4
+ data.tar.gz: 897b8ece8bff0033b42ef8c88644fb1b60e84ba2
5
5
  SHA512:
6
- metadata.gz: 37cb5dd9b49bd082cf1d41b982c8e97e2d7a0bf1e1019b80dce297cfdd455611443fa715eec3dddcef2e396d9545e89a1d88fc5aec4589cce71dabbdbf33051d
7
- data.tar.gz: 7ce04147959ffa29e42a152d066599f163577ab077c4176dcf61540eefb5d98f34fe1cbb0e49087efe70022d2b3c185b87dad0fb23a7d8b938861f562355aaa9
6
+ metadata.gz: 09e1bd456fc049d6ef46df54f4e24712c53a31996a596ecf3f53d65653513099c867db157e463f1cb1e2ef8477fdc8c6ea29f041727133809013e68c92f6fbd8
7
+ data.tar.gz: d0ae317598bf5c1f74759fc0cde0f5cd61b11faeaacf94390311347c759fd05044540b04a4a506191c36cbe13c9183bc19c6b8bfdf6de66062c55a2843102768
@@ -326,7 +326,7 @@ This is called automatically if extend is called on an object.</p>
326
326
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize_ionian</span>
327
327
  <span class="ruby-ivar">@ionian_listeners</span> = []
328
328
  <span class="ruby-ivar">@ionian_buf</span> = <span class="ruby-string">&#39;&#39;</span>
329
- <span class="ruby-ivar">@ionian_expression</span> = <span class="ruby-regexp">/(.*?)\r?\n?/</span>
329
+ <span class="ruby-ivar">@ionian_expression</span> = <span class="ruby-regexp">/(.*?)[\r\n]+/</span>
330
330
  <span class="ruby-ivar">@ionian_timeout</span> = <span class="ruby-keyword">nil</span>
331
331
  <span class="ruby-ivar">@ionian_skip_select</span> = <span class="ruby-keyword">false</span>
332
332
  <span class="ruby-ivar">@ionian_build_methods</span> = <span class="ruby-keyword">true</span>
@@ -527,8 +527,8 @@ build_methods: Build accessor methods from named capture groups.
527
527
  <span class="ruby-keyword">end</span>
528
528
  <span class="ruby-keyword">end</span>
529
529
 
530
- <span class="ruby-comment"># Notify on_match listeners.</span>
531
- <span class="ruby-ivar">@matches</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span> <span class="ruby-identifier">notify_listeners</span> <span class="ruby-identifier">match</span>} <span class="ruby-keyword">if</span> <span class="ruby-identifier">notify</span>
530
+ <span class="ruby-comment"># Notify on_match listeners unless the #run_match thread is active.</span>
531
+ <span class="ruby-ivar">@matches</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span> <span class="ruby-identifier">notify_listeners</span> <span class="ruby-identifier">match</span>} <span class="ruby-keyword">if</span> <span class="ruby-identifier">notify</span> <span class="ruby-keyword">and</span> <span class="ruby-keyword">not</span> <span class="ruby-ivar">@match_listener</span>
532
532
 
533
533
  <span class="ruby-ivar">@matches</span>
534
534
  <span class="ruby-keyword">end</span></pre>
@@ -108,6 +108,10 @@
108
108
 
109
109
  <li ><a href="#method-i-cmd">#cmd</a>
110
110
 
111
+ <li ><a href="#method-i-expression">#expression</a>
112
+
113
+ <li ><a href="#method-i-expression-3D">#expression=</a>
114
+
111
115
  <li ><a href="#method-i-flush">#flush</a>
112
116
 
113
117
  <li ><a href="#method-i-has_data-3F">#has_data?</a>
@@ -158,19 +162,6 @@
158
162
  </header>
159
163
 
160
164
 
161
- <div id="attribute-i-expression" class="method-detail">
162
- <div class="method-heading attribute-method-heading">
163
- <span class="method-name">expression</span><span
164
- class="attribute-access-type">[RW]</span>
165
- </div>
166
-
167
- <div class="method-description">
168
-
169
- <p>Returns the regular expression used to match incoming data.</p>
170
-
171
- </div>
172
- </div>
173
-
174
165
  <div id="attribute-i-protocol" class="method-detail">
175
166
  <div class="method-heading attribute-method-heading">
176
167
  <span class="method-name">protocol</span><span
@@ -245,7 +236,7 @@ expression: Overrides the #read_match regular expression for received data.</pre
245
236
 
246
237
 
247
238
  <div class="method-source-code" id="new-source">
248
- <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 27</span>
239
+ <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 25</span>
249
240
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">existing_socket</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-operator">**</span><span class="ruby-identifier">kwargs</span>)
250
241
  <span class="ruby-ivar">@socket</span> = <span class="ruby-identifier">existing_socket</span>
251
242
 
@@ -371,7 +362,7 @@ expression: Overrides the #read_match regular expression for received data.</pre
371
362
 
372
363
 
373
364
  <div class="method-source-code" id="closed-3F-source">
374
- <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 150</span>
365
+ <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 159</span>
375
366
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">closed?</span>
376
367
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@socket</span>
377
368
  <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">closed?</span>
@@ -407,7 +398,7 @@ href="Extension/IO.html#method-i-read_match">Ionian::Extension::IO#read_match</a
407
398
 
408
399
 
409
400
  <div class="method-source-code" id="cmd-source">
410
- <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 102</span>
401
+ <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 111</span>
411
402
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">cmd</span>(<span class="ruby-identifier">string</span>, <span class="ruby-operator">**</span><span class="ruby-identifier">kwargs</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
412
403
  <span class="ruby-identifier">create_socket</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@persistent</span>
413
404
 
@@ -431,6 +422,73 @@ href="Extension/IO.html#method-i-read_match">Ionian::Extension::IO#read_match</a
431
422
 
432
423
 
433
424
 
425
+ </div>
426
+
427
+
428
+ <div id="method-i-expression" class="method-detail ">
429
+
430
+ <div class="method-heading">
431
+ <span class="method-name">expression</span><span
432
+ class="method-args">()</span>
433
+
434
+ <span class="method-click-advice">click to toggle source</span>
435
+
436
+ </div>
437
+
438
+
439
+ <div class="method-description">
440
+
441
+ <p>Returns the regular expression used to match incoming data.</p>
442
+
443
+
444
+
445
+
446
+ <div class="method-source-code" id="expression-source">
447
+ <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 92</span>
448
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">expression</span>
449
+ <span class="ruby-ivar">@expression</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">expression</span>
450
+ <span class="ruby-keyword">end</span></pre>
451
+ </div>
452
+
453
+ </div>
454
+
455
+
456
+
457
+
458
+ </div>
459
+
460
+
461
+ <div id="method-i-expression-3D" class="method-detail ">
462
+
463
+ <div class="method-heading">
464
+ <span class="method-name">expression=</span><span
465
+ class="method-args">(exp)</span>
466
+
467
+ <span class="method-click-advice">click to toggle source</span>
468
+
469
+ </div>
470
+
471
+
472
+ <div class="method-description">
473
+
474
+ <p>Set the regular expression used to match incoming data.</p>
475
+
476
+
477
+
478
+
479
+ <div class="method-source-code" id="expression-3D-source">
480
+ <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 97</span>
481
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">expression=</span>(<span class="ruby-identifier">exp</span>)
482
+ <span class="ruby-ivar">@expression</span> = <span class="ruby-identifier">exp</span>
483
+ <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">expression</span> = <span class="ruby-identifier">exp</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@socket</span>
484
+ <span class="ruby-keyword">end</span></pre>
485
+ </div>
486
+
487
+ </div>
488
+
489
+
490
+
491
+
434
492
  </div>
435
493
 
436
494
 
@@ -454,7 +512,7 @@ non-persistent sockets.</p>
454
512
 
455
513
 
456
514
  <div class="method-source-code" id="flush-source">
457
- <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 157</span>
515
+ <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 166</span>
458
516
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">flush</span>
459
517
  <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">flush</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@persistent</span>
460
518
  <span class="ruby-keyword">end</span></pre>
@@ -490,7 +548,7 @@ non-persistent sockets.</p>
490
548
 
491
549
 
492
550
  <div class="method-source-code" id="has_data-3F-source">
493
- <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 144</span>
551
+ <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 153</span>
494
552
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">has_data?</span>(<span class="ruby-operator">**</span><span class="ruby-identifier">kwargs</span>)
495
553
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@socket</span>
496
554
  <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">has_data?</span> <span class="ruby-identifier">kwargs</span>
@@ -552,7 +610,7 @@ non-persistent sockets.</p>
552
610
 
553
611
 
554
612
  <div class="method-source-code" id="persistent-3F-source">
555
- <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 94</span>
613
+ <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 103</span>
556
614
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">persistent?</span>
557
615
  <span class="ruby-ivar">@persistent</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">false</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@persistent</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">?</span> <span class="ruby-keyword">false</span> <span class="ruby-operator">:</span> <span class="ruby-keyword">true</span>
558
616
  <span class="ruby-keyword">end</span></pre>
@@ -586,7 +644,7 @@ any string not already ending with one.</p>
586
644
 
587
645
 
588
646
  <div class="method-source-code" id="puts-source">
589
- <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 163</span>
647
+ <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 172</span>
590
648
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">puts</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">string</span>)
591
649
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">write</span> <span class="ruby-identifier">string</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">chomp</span>}.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;\n&quot;</span>) <span class="ruby-operator">+</span> <span class="ruby-string">&quot;\n&quot;</span>
592
650
  <span class="ruby-keyword">end</span></pre>
@@ -621,7 +679,7 @@ reference to the given block. block = ionian_socket.register_observer {…}</p>
621
679
 
622
680
 
623
681
  <div class="method-source-code" id="register_observer-source">
624
- <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 123</span>
682
+ <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 132</span>
625
683
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">register_observer</span> <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
626
684
  <span class="ruby-ivar">@ionian_listeners</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">block</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@ionian_listeners</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">block</span>
627
685
  <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">register_observer</span> <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@socket</span>
@@ -660,7 +718,7 @@ reference to the given block. block = ionian_socket.register_observer {…}</p>
660
718
 
661
719
 
662
720
  <div class="method-source-code" id="unregister_observer-source">
663
- <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 132</span>
721
+ <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 141</span>
664
722
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">unregister_observer</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
665
723
  <span class="ruby-ivar">@ionian_listeners</span>.<span class="ruby-identifier">delete_if</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">o</span><span class="ruby-operator">|</span> <span class="ruby-identifier">o</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">block</span>}
666
724
  <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">unregister_observer</span> <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@socket</span>
@@ -695,7 +753,7 @@ reference to the given block. block = ionian_socket.register_observer {…}</p>
695
753
 
696
754
 
697
755
  <div class="method-source-code" id="write-source">
698
- <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 169</span>
756
+ <pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 178</span>
699
757
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">write</span>(<span class="ruby-identifier">string</span>)
700
758
  <span class="ruby-identifier">create_socket</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@persistent</span>
701
759
 
data/doc/created.rid CHANGED
@@ -1,6 +1,6 @@
1
- Sun, 26 Jan 2014 13:05:49 -0800
1
+ Sun, 26 Jan 2014 18:41:21 -0800
2
2
  lib/ionian.rb Mon, 20 Jan 2014 16:23:59 -0800
3
- lib/ionian/extension/io.rb Fri, 24 Jan 2014 15:44:42 -0800
3
+ lib/ionian/extension/io.rb Sun, 26 Jan 2014 18:36:45 -0800
4
4
  lib/ionian/extension/socket.rb Fri, 24 Jan 2014 22:04:33 -0800
5
5
  lib/ionian/server.rb Sun, 26 Jan 2014 12:56:50 -0800
6
- lib/ionian/socket.rb Fri, 24 Jan 2014 22:03:54 -0800
6
+ lib/ionian/socket.rb Sun, 26 Jan 2014 18:34:36 -0800
@@ -1 +1 @@
1
- var search_data = {"index":{"searchIndex":["ionian","extension","io","socket","server","socket","<<()","close()","closed?()","closed?()","cmd()","cork()","cork=()","cork?()","expression()","expression=()","extended()","extended()","flush()","has_data?()","has_data?()","initialize_ionian()","initialize_ionian_socket()","ip_add_membership()","ip_drop_membership()","ip_multicast_if()","ip_multicast_if=()","ip_multicast_loop()","ip_multicast_loop=()","ip_multicast_loop?()","ip_multicast_ttl()","ip_multicast_ttl=()","ipv6_add_membership()","ipv6_drop_membership()","ipv6_multicast_hops()","ipv6_multicast_hops=()","ipv6_multicast_if()","ipv6_multicast_if=()","ipv6_multicast_loop()","ipv6_multicast_loop=()","ipv6_multicast_loop?()","listen()","multicast()","multicast?()","new()","new()","no_delay()","no_delay=()","no_delay?()","on_accept()","on_match()","on_match()","persistent?()","purge()","puts()","read_all()","read_match()","recork()","register_accept_listener()","register_observer()","register_observer()","reuse_addr()","reuse_addr=()","reuse_addr?()","run_match()","ttl()","ttl=()","ttl?()","unregister_accept_listener()","unregister_observer()","unregister_observer()","write()"],"longSearchIndex":["ionian","ionian::extension","ionian::extension::io","ionian::extension::socket","ionian::server","ionian::socket","ionian::socket#<<()","ionian::server#close()","ionian::server#closed?()","ionian::socket#closed?()","ionian::socket#cmd()","ionian::extension::socket#cork()","ionian::extension::socket#cork=()","ionian::extension::socket#cork?()","ionian::extension::io#expression()","ionian::extension::io#expression=()","ionian::extension::io::extended()","ionian::extension::socket::extended()","ionian::socket#flush()","ionian::extension::io#has_data?()","ionian::socket#has_data?()","ionian::extension::io#initialize_ionian()","ionian::extension::socket#initialize_ionian_socket()","ionian::extension::socket#ip_add_membership()","ionian::extension::socket#ip_drop_membership()","ionian::extension::socket#ip_multicast_if()","ionian::extension::socket#ip_multicast_if=()","ionian::extension::socket#ip_multicast_loop()","ionian::extension::socket#ip_multicast_loop=()","ionian::extension::socket#ip_multicast_loop?()","ionian::extension::socket#ip_multicast_ttl()","ionian::extension::socket#ip_multicast_ttl=()","ionian::extension::socket#ipv6_add_membership()","ionian::extension::socket#ipv6_drop_membership()","ionian::extension::socket#ipv6_multicast_hops()","ionian::extension::socket#ipv6_multicast_hops=()","ionian::extension::socket#ipv6_multicast_if()","ionian::extension::socket#ipv6_multicast_if=()","ionian::extension::socket#ipv6_multicast_loop()","ionian::extension::socket#ipv6_multicast_loop=()","ionian::extension::socket#ipv6_multicast_loop?()","ionian::server#listen()","ionian::extension::socket#multicast()","ionian::extension::socket#multicast?()","ionian::server::new()","ionian::socket::new()","ionian::extension::socket#no_delay()","ionian::extension::socket#no_delay=()","ionian::extension::socket#no_delay?()","ionian::server#on_accept()","ionian::extension::io#on_match()","ionian::socket#on_match()","ionian::socket#persistent?()","ionian::extension::io#purge()","ionian::socket#puts()","ionian::extension::io#read_all()","ionian::extension::io#read_match()","ionian::extension::socket#recork()","ionian::server#register_accept_listener()","ionian::extension::io#register_observer()","ionian::socket#register_observer()","ionian::extension::socket#reuse_addr()","ionian::extension::socket#reuse_addr=()","ionian::extension::socket#reuse_addr?()","ionian::extension::io#run_match()","ionian::extension::socket#ttl()","ionian::extension::socket#ttl=()","ionian::extension::socket#ttl?()","ionian::server#unregister_accept_listener()","ionian::extension::io#unregister_observer()","ionian::socket#unregister_observer()","ionian::socket#write()"],"info":[["Ionian","","Ionian.html","","<p>A library to simplify interaction with IO streams. This includes network\nsockets, file sockets, and serial …\n"],["Ionian::Extension","","Ionian/Extension.html","","<p>A collection of mixins.\n"],["Ionian::Extension::IO","","Ionian/Extension/IO.html","","<p>A mixin for IO objects that allows regular expression matching and\nconvenient notification of received …\n"],["Ionian::Extension::Socket","","Ionian/Extension/Socket.html","","<p>A mixin for Socket objects.\n<p>This module was designed to be extended by instantiated objects that\nimplement …\n"],["Ionian::Server","","Ionian/Server.html","","<p>A convenient wrapper for TCP, UDP, and Unix server sockets.\n"],["Ionian::Socket","","Ionian/Socket.html","","<p>A convenient wrapper for TCP, UDP, and Unix client sockets.\n"],["<<","Ionian::Socket","Ionian/Socket.html#method-i-3C-3C","(string)",""],["close","Ionian::Server","Ionian/Server.html#method-i-close","()","<p>Shutdown the server socket and stop listening for connections.\n"],["closed?","Ionian::Server","Ionian/Server.html#method-i-closed-3F","()","<p>Returns true if the server listener socket is closed.\n"],["closed?","Ionian::Socket","Ionian/Socket.html#method-i-closed-3F","()","<p>Returns true if the socket is closed.\n"],["cmd","Ionian::Socket","Ionian/Socket.html#method-i-cmd","(string, **kwargs, &block)","<p>Send a command (data) to the socket. Returns an array of received matches.\nBlock yields received match. …\n"],["cork","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-cork","()","<p>Returns true if multiple writes are buffered into a single segment. See\n#recork. Linux only. ( TCP_CORK …\n"],["cork=","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-cork-3D","(value)","<p>Buffers multiple writes into a single segment if true. The segment is sent\nonce the cork flag is disabled, …\n"],["cork?","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-cork-3F","()",""],["expression","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-expression","()","<p>Returns the regular expression used for #read_match.\n"],["expression=","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-expression-3D","(exp)","<p>Set the expression to match against the read buffer. Can be a regular\nexpression specifying capture groups, …\n"],["extended","Ionian::Extension::IO","Ionian/Extension/IO.html#method-c-extended","(obj)","<p>Called automaticallly when the object is extended with #extend.\n"],["extended","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-c-extended","(obj)","<p>Called automaticallly when the object is extended with #extend.\n"],["flush","Ionian::Socket","Ionian/Socket.html#method-i-flush","()","<p>Flushes buffered data to the operating system. This method has no effect on\nnon-persistent sockets.\n"],["has_data?","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-has_data-3F","(timeout: 0)","<p>Returns true if there is data in the receive buffer. Args:\n\n<pre>Timeout: Number of seconds to wait for data ...</pre>\n"],["has_data?","Ionian::Socket","Ionian/Socket.html#method-i-has_data-3F","(**kwargs)","<p>Returns true if there is data in the receive buffer. Args:\n\n<pre>Timeout: Number of seconds to wait for data ...</pre>\n"],["initialize_ionian","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-initialize_ionian","()","<p>Initialize the Ionian instance variables. This is called automatically if\n#extend is called on an object. …\n"],["initialize_ionian_socket","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-initialize_ionian_socket","()","<p>Initialize the Ionian Socket variables. This is called automatically if\n#extend is called on an object. …\n"],["ip_add_membership","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ip_add_membership","(address = nil, interface = nil)","<p>Join a multicast group. Address is the class D multicast address (uses\nremote address if not specified). …\n"],["ip_drop_membership","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ip_drop_membership","(address = nil, interface = nil)","<p>Leave a multicast group. Address is the class D multicast address (uses\nremote address if not specified). …\n"],["ip_multicast_if","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ip_multicast_if","()","<p>Returns the default interface for outgoing multicasts. ( IP_MULTICAST_IF )\n"],["ip_multicast_if=","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ip_multicast_if-3D","(interface = nil)","<p>Specify default interface for outgoing multicasts. ( IP_MULTICAST_IF )\n"],["ip_multicast_loop","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ip_multicast_loop","()","<p>Returns true if loopback of outgoing multicasts is enabled. (\nIP_MULTICAST_LOOP )\n"],["ip_multicast_loop=","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ip_multicast_loop-3D","(value)","<p>Enables loopback of outgoing multicasts if true. ( IP_MULTICAST_LOOP )\n"],["ip_multicast_loop?","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ip_multicast_loop-3F","()",""],["ip_multicast_ttl","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ip_multicast_ttl","()","<p>Returns the time to live (hop limit) for outgoing multicasts. (\nIP_MULTICAST_TTL )\n"],["ip_multicast_ttl=","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ip_multicast_ttl-3D","(value)","<p>Set the time to live (hop limit) for outgoing multicasts. (\nIP_MULTICAST_TTL )\n"],["ipv6_add_membership","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ipv6_add_membership","()","<p>Not yet implemented.\n"],["ipv6_drop_membership","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ipv6_drop_membership","()","<p>Not yet implemented.\n"],["ipv6_multicast_hops","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ipv6_multicast_hops","()","<p>Not yet implemented.\n"],["ipv6_multicast_hops=","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ipv6_multicast_hops-3D","(value)","<p>Not yet implemented.\n"],["ipv6_multicast_if","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ipv6_multicast_if","()","<p>Not yet implemented.\n"],["ipv6_multicast_if=","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ipv6_multicast_if-3D","(value)","<p>Not yet implemented.\n"],["ipv6_multicast_loop","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ipv6_multicast_loop","()","<p>Not yet implemented.\n"],["ipv6_multicast_loop=","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ipv6_multicast_loop-3D","(value)","<p>Not yet implemented.\n"],["ipv6_multicast_loop?","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ipv6_multicast_loop-3F","()",""],["listen","Ionian::Server","Ionian/Server.html#method-i-listen","(&block)","<p>Starts the socket server listening for connections. Blocks registered with\n#register_accept_listener …\n"],["multicast","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-multicast","(address)","<p>Returns true if the given address is within the multicast range.\n"],["multicast?","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-multicast-3F","(address)",""],["new","Ionian::Server","Ionian/Server.html#method-c-new","(**kwargs, &block)","<p>A convenient wrapper for TCP and Unix server sockets (UDP doesn&#39;t use a\nserver).\n<p>Accepts an optional …\n"],["new","Ionian::Socket","Ionian/Socket.html#method-c-new","(existing_socket = nil, **kwargs)","<p>Creates a new socket or wraps an existing socket.\n<p>Args:\n\n<pre>host: IP or hostname to connect to.\nport: ...</pre>\n"],["no_delay","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-no_delay","()","<p>Returns true if the Nagle algorithm is disabled. ( TCP_NODELAY )\n"],["no_delay=","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-no_delay-3D","(value)","<p>Disables the Nagle algorithm if true. ( TCP_NODELAY )\n"],["no_delay?","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-no_delay-3F","()",""],["on_accept","Ionian::Server","Ionian/Server.html#method-i-on_accept","(&block)",""],["on_match","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-on_match","(&block)",""],["on_match","Ionian::Socket","Ionian/Socket.html#method-i-on_match","(&block)",""],["persistent?","Ionian::Socket","Ionian/Socket.html#method-i-persistent-3F","()","<p>Returns true if the socket remains open after writing data.\n"],["purge","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-purge","()","<p>Erase the data in the IO and Ionian buffers. This is typically handled\nautomatically.\n"],["puts","Ionian::Socket","Ionian/Socket.html#method-i-puts","(*string)","<p>Writes the given string(s) to the socket and appends a newline character to\nany string not already ending …\n"],["read_all","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-read_all","()","<p>Read all data in the buffer. An alternative to using #readpartial with a\nlarge length.\n"],["read_match","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-read_match","(**kwargs, &block)","<p>Read matched data from the buffer. This method SHOULD NOT be used if\n#run_match is used.\n<p>Passes matches …\n"],["recork","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-recork","()","<p>Unsets cork to transmit data, then reapplies cork. ( TCP_CORK )\n"],["register_accept_listener","Ionian::Server","Ionian/Server.html#method-i-register_accept_listener","(&block)","<p>Register a block to be run when server accepts a client connection. The\nconnected client is passed to …\n"],["register_observer","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-register_observer","(&block)","<p>Register a block to be called when #run_match receives matched data. Method\ncallbacks can be registered …\n"],["register_observer","Ionian::Socket","Ionian/Socket.html#method-i-register_observer","(&block)","<p>Register a block to be called when #run_match receives matched data. Method\ncallbacks can be registered …\n"],["reuse_addr","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-reuse_addr","()","<p>Returns true if local address reuse is allowed. ( SO_REUSEADDR )\n"],["reuse_addr=","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-reuse_addr-3D","(value)","<p>Allows local address reuse if true. ( SO_REUSEADDR )\n"],["reuse_addr?","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-reuse_addr-3F","()",""],["run_match","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-run_match","(**kwargs)","<p>Start a thread that checks for data and notifies listeners (do |match,\nsocket|). Passes kwargs to #read_match …\n"],["ttl","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ttl","()","<p>Returns the time to live (hop limit). ( IP_TTL )\n"],["ttl=","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ttl-3D","(value)","<p>Sets the time to live (hop limit). ( IP_TTL )\n"],["ttl?","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ttl-3F","()",""],["unregister_accept_listener","Ionian::Server","Ionian/Server.html#method-i-unregister_accept_listener","(proc)","<p>Unregisters a socket accept notifier block.\n"],["unregister_observer","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-unregister_observer","(&block)","<p>Unregister a block from being called when matched data is received.\n"],["unregister_observer","Ionian::Socket","Ionian/Socket.html#method-i-unregister_observer","(&block)","<p>Unregister a block from being called when matched data is received.\n"],["write","Ionian::Socket","Ionian/Socket.html#method-i-write","(string)","<p>Writes the given string to the socket. Returns the number of bytes written.\n"]]}}
1
+ var search_data = {"index":{"searchIndex":["ionian","extension","io","socket","server","socket","<<()","close()","closed?()","closed?()","cmd()","cork()","cork=()","cork?()","expression()","expression()","expression=()","expression=()","extended()","extended()","flush()","has_data?()","has_data?()","initialize_ionian()","initialize_ionian_socket()","ip_add_membership()","ip_drop_membership()","ip_multicast_if()","ip_multicast_if=()","ip_multicast_loop()","ip_multicast_loop=()","ip_multicast_loop?()","ip_multicast_ttl()","ip_multicast_ttl=()","ipv6_add_membership()","ipv6_drop_membership()","ipv6_multicast_hops()","ipv6_multicast_hops=()","ipv6_multicast_if()","ipv6_multicast_if=()","ipv6_multicast_loop()","ipv6_multicast_loop=()","ipv6_multicast_loop?()","listen()","multicast()","multicast?()","new()","new()","no_delay()","no_delay=()","no_delay?()","on_accept()","on_match()","on_match()","persistent?()","purge()","puts()","read_all()","read_match()","recork()","register_accept_listener()","register_observer()","register_observer()","reuse_addr()","reuse_addr=()","reuse_addr?()","run_match()","ttl()","ttl=()","ttl?()","unregister_accept_listener()","unregister_observer()","unregister_observer()","write()"],"longSearchIndex":["ionian","ionian::extension","ionian::extension::io","ionian::extension::socket","ionian::server","ionian::socket","ionian::socket#<<()","ionian::server#close()","ionian::server#closed?()","ionian::socket#closed?()","ionian::socket#cmd()","ionian::extension::socket#cork()","ionian::extension::socket#cork=()","ionian::extension::socket#cork?()","ionian::extension::io#expression()","ionian::socket#expression()","ionian::extension::io#expression=()","ionian::socket#expression=()","ionian::extension::io::extended()","ionian::extension::socket::extended()","ionian::socket#flush()","ionian::extension::io#has_data?()","ionian::socket#has_data?()","ionian::extension::io#initialize_ionian()","ionian::extension::socket#initialize_ionian_socket()","ionian::extension::socket#ip_add_membership()","ionian::extension::socket#ip_drop_membership()","ionian::extension::socket#ip_multicast_if()","ionian::extension::socket#ip_multicast_if=()","ionian::extension::socket#ip_multicast_loop()","ionian::extension::socket#ip_multicast_loop=()","ionian::extension::socket#ip_multicast_loop?()","ionian::extension::socket#ip_multicast_ttl()","ionian::extension::socket#ip_multicast_ttl=()","ionian::extension::socket#ipv6_add_membership()","ionian::extension::socket#ipv6_drop_membership()","ionian::extension::socket#ipv6_multicast_hops()","ionian::extension::socket#ipv6_multicast_hops=()","ionian::extension::socket#ipv6_multicast_if()","ionian::extension::socket#ipv6_multicast_if=()","ionian::extension::socket#ipv6_multicast_loop()","ionian::extension::socket#ipv6_multicast_loop=()","ionian::extension::socket#ipv6_multicast_loop?()","ionian::server#listen()","ionian::extension::socket#multicast()","ionian::extension::socket#multicast?()","ionian::server::new()","ionian::socket::new()","ionian::extension::socket#no_delay()","ionian::extension::socket#no_delay=()","ionian::extension::socket#no_delay?()","ionian::server#on_accept()","ionian::extension::io#on_match()","ionian::socket#on_match()","ionian::socket#persistent?()","ionian::extension::io#purge()","ionian::socket#puts()","ionian::extension::io#read_all()","ionian::extension::io#read_match()","ionian::extension::socket#recork()","ionian::server#register_accept_listener()","ionian::extension::io#register_observer()","ionian::socket#register_observer()","ionian::extension::socket#reuse_addr()","ionian::extension::socket#reuse_addr=()","ionian::extension::socket#reuse_addr?()","ionian::extension::io#run_match()","ionian::extension::socket#ttl()","ionian::extension::socket#ttl=()","ionian::extension::socket#ttl?()","ionian::server#unregister_accept_listener()","ionian::extension::io#unregister_observer()","ionian::socket#unregister_observer()","ionian::socket#write()"],"info":[["Ionian","","Ionian.html","","<p>A library to simplify interaction with IO streams. This includes network\nsockets, file sockets, and serial …\n"],["Ionian::Extension","","Ionian/Extension.html","","<p>A collection of mixins.\n"],["Ionian::Extension::IO","","Ionian/Extension/IO.html","","<p>A mixin for IO objects that allows regular expression matching and\nconvenient notification of received …\n"],["Ionian::Extension::Socket","","Ionian/Extension/Socket.html","","<p>A mixin for Socket objects.\n<p>This module was designed to be extended by instantiated objects that\nimplement …\n"],["Ionian::Server","","Ionian/Server.html","","<p>A convenient wrapper for TCP, UDP, and Unix server sockets.\n"],["Ionian::Socket","","Ionian/Socket.html","","<p>A convenient wrapper for TCP, UDP, and Unix client sockets.\n"],["<<","Ionian::Socket","Ionian/Socket.html#method-i-3C-3C","(string)",""],["close","Ionian::Server","Ionian/Server.html#method-i-close","()","<p>Shutdown the server socket and stop listening for connections.\n"],["closed?","Ionian::Server","Ionian/Server.html#method-i-closed-3F","()","<p>Returns true if the server listener socket is closed.\n"],["closed?","Ionian::Socket","Ionian/Socket.html#method-i-closed-3F","()","<p>Returns true if the socket is closed.\n"],["cmd","Ionian::Socket","Ionian/Socket.html#method-i-cmd","(string, **kwargs, &block)","<p>Send a command (data) to the socket. Returns an array of received matches.\nBlock yields received match. …\n"],["cork","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-cork","()","<p>Returns true if multiple writes are buffered into a single segment. See\n#recork. Linux only. ( TCP_CORK …\n"],["cork=","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-cork-3D","(value)","<p>Buffers multiple writes into a single segment if true. The segment is sent\nonce the cork flag is disabled, …\n"],["cork?","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-cork-3F","()",""],["expression","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-expression","()","<p>Returns the regular expression used for #read_match.\n"],["expression","Ionian::Socket","Ionian/Socket.html#method-i-expression","()","<p>Returns the regular expression used to match incoming data.\n"],["expression=","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-expression-3D","(exp)","<p>Set the expression to match against the read buffer. Can be a regular\nexpression specifying capture groups, …\n"],["expression=","Ionian::Socket","Ionian/Socket.html#method-i-expression-3D","(exp)","<p>Set the regular expression used to match incoming data.\n"],["extended","Ionian::Extension::IO","Ionian/Extension/IO.html#method-c-extended","(obj)","<p>Called automaticallly when the object is extended with #extend.\n"],["extended","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-c-extended","(obj)","<p>Called automaticallly when the object is extended with #extend.\n"],["flush","Ionian::Socket","Ionian/Socket.html#method-i-flush","()","<p>Flushes buffered data to the operating system. This method has no effect on\nnon-persistent sockets.\n"],["has_data?","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-has_data-3F","(timeout: 0)","<p>Returns true if there is data in the receive buffer. Args:\n\n<pre>Timeout: Number of seconds to wait for data ...</pre>\n"],["has_data?","Ionian::Socket","Ionian/Socket.html#method-i-has_data-3F","(**kwargs)","<p>Returns true if there is data in the receive buffer. Args:\n\n<pre>Timeout: Number of seconds to wait for data ...</pre>\n"],["initialize_ionian","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-initialize_ionian","()","<p>Initialize the Ionian instance variables. This is called automatically if\n#extend is called on an object. …\n"],["initialize_ionian_socket","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-initialize_ionian_socket","()","<p>Initialize the Ionian Socket variables. This is called automatically if\n#extend is called on an object. …\n"],["ip_add_membership","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ip_add_membership","(address = nil, interface = nil)","<p>Join a multicast group. Address is the class D multicast address (uses\nremote address if not specified). …\n"],["ip_drop_membership","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ip_drop_membership","(address = nil, interface = nil)","<p>Leave a multicast group. Address is the class D multicast address (uses\nremote address if not specified). …\n"],["ip_multicast_if","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ip_multicast_if","()","<p>Returns the default interface for outgoing multicasts. ( IP_MULTICAST_IF )\n"],["ip_multicast_if=","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ip_multicast_if-3D","(interface = nil)","<p>Specify default interface for outgoing multicasts. ( IP_MULTICAST_IF )\n"],["ip_multicast_loop","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ip_multicast_loop","()","<p>Returns true if loopback of outgoing multicasts is enabled. (\nIP_MULTICAST_LOOP )\n"],["ip_multicast_loop=","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ip_multicast_loop-3D","(value)","<p>Enables loopback of outgoing multicasts if true. ( IP_MULTICAST_LOOP )\n"],["ip_multicast_loop?","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ip_multicast_loop-3F","()",""],["ip_multicast_ttl","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ip_multicast_ttl","()","<p>Returns the time to live (hop limit) for outgoing multicasts. (\nIP_MULTICAST_TTL )\n"],["ip_multicast_ttl=","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ip_multicast_ttl-3D","(value)","<p>Set the time to live (hop limit) for outgoing multicasts. (\nIP_MULTICAST_TTL )\n"],["ipv6_add_membership","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ipv6_add_membership","()","<p>Not yet implemented.\n"],["ipv6_drop_membership","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ipv6_drop_membership","()","<p>Not yet implemented.\n"],["ipv6_multicast_hops","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ipv6_multicast_hops","()","<p>Not yet implemented.\n"],["ipv6_multicast_hops=","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ipv6_multicast_hops-3D","(value)","<p>Not yet implemented.\n"],["ipv6_multicast_if","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ipv6_multicast_if","()","<p>Not yet implemented.\n"],["ipv6_multicast_if=","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ipv6_multicast_if-3D","(value)","<p>Not yet implemented.\n"],["ipv6_multicast_loop","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ipv6_multicast_loop","()","<p>Not yet implemented.\n"],["ipv6_multicast_loop=","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ipv6_multicast_loop-3D","(value)","<p>Not yet implemented.\n"],["ipv6_multicast_loop?","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ipv6_multicast_loop-3F","()",""],["listen","Ionian::Server","Ionian/Server.html#method-i-listen","(&block)","<p>Starts the socket server listening for connections. Blocks registered with\n#register_accept_listener …\n"],["multicast","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-multicast","(address)","<p>Returns true if the given address is within the multicast range.\n"],["multicast?","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-multicast-3F","(address)",""],["new","Ionian::Server","Ionian/Server.html#method-c-new","(**kwargs, &block)","<p>A convenient wrapper for TCP and Unix server sockets (UDP doesn&#39;t use a\nserver).\n<p>Accepts an optional …\n"],["new","Ionian::Socket","Ionian/Socket.html#method-c-new","(existing_socket = nil, **kwargs)","<p>Creates a new socket or wraps an existing socket.\n<p>Args:\n\n<pre>host: IP or hostname to connect to.\nport: ...</pre>\n"],["no_delay","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-no_delay","()","<p>Returns true if the Nagle algorithm is disabled. ( TCP_NODELAY )\n"],["no_delay=","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-no_delay-3D","(value)","<p>Disables the Nagle algorithm if true. ( TCP_NODELAY )\n"],["no_delay?","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-no_delay-3F","()",""],["on_accept","Ionian::Server","Ionian/Server.html#method-i-on_accept","(&block)",""],["on_match","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-on_match","(&block)",""],["on_match","Ionian::Socket","Ionian/Socket.html#method-i-on_match","(&block)",""],["persistent?","Ionian::Socket","Ionian/Socket.html#method-i-persistent-3F","()","<p>Returns true if the socket remains open after writing data.\n"],["purge","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-purge","()","<p>Erase the data in the IO and Ionian buffers. This is typically handled\nautomatically.\n"],["puts","Ionian::Socket","Ionian/Socket.html#method-i-puts","(*string)","<p>Writes the given string(s) to the socket and appends a newline character to\nany string not already ending …\n"],["read_all","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-read_all","()","<p>Read all data in the buffer. An alternative to using #readpartial with a\nlarge length.\n"],["read_match","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-read_match","(**kwargs, &block)","<p>Read matched data from the buffer. This method SHOULD NOT be used if\n#run_match is used.\n<p>Passes matches …\n"],["recork","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-recork","()","<p>Unsets cork to transmit data, then reapplies cork. ( TCP_CORK )\n"],["register_accept_listener","Ionian::Server","Ionian/Server.html#method-i-register_accept_listener","(&block)","<p>Register a block to be run when server accepts a client connection. The\nconnected client is passed to …\n"],["register_observer","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-register_observer","(&block)","<p>Register a block to be called when #run_match receives matched data. Method\ncallbacks can be registered …\n"],["register_observer","Ionian::Socket","Ionian/Socket.html#method-i-register_observer","(&block)","<p>Register a block to be called when #run_match receives matched data. Method\ncallbacks can be registered …\n"],["reuse_addr","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-reuse_addr","()","<p>Returns true if local address reuse is allowed. ( SO_REUSEADDR )\n"],["reuse_addr=","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-reuse_addr-3D","(value)","<p>Allows local address reuse if true. ( SO_REUSEADDR )\n"],["reuse_addr?","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-reuse_addr-3F","()",""],["run_match","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-run_match","(**kwargs)","<p>Start a thread that checks for data and notifies listeners (do |match,\nsocket|). Passes kwargs to #read_match …\n"],["ttl","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ttl","()","<p>Returns the time to live (hop limit). ( IP_TTL )\n"],["ttl=","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ttl-3D","(value)","<p>Sets the time to live (hop limit). ( IP_TTL )\n"],["ttl?","Ionian::Extension::Socket","Ionian/Extension/Socket.html#method-i-ttl-3F","()",""],["unregister_accept_listener","Ionian::Server","Ionian/Server.html#method-i-unregister_accept_listener","(proc)","<p>Unregisters a socket accept notifier block.\n"],["unregister_observer","Ionian::Extension::IO","Ionian/Extension/IO.html#method-i-unregister_observer","(&block)","<p>Unregister a block from being called when matched data is received.\n"],["unregister_observer","Ionian::Socket","Ionian/Socket.html#method-i-unregister_observer","(&block)","<p>Unregister a block from being called when matched data is received.\n"],["write","Ionian::Socket","Ionian/Socket.html#method-i-write","(string)","<p>Writes the given string to the socket. Returns the number of bytes written.\n"]]}}
@@ -111,11 +111,21 @@
111
111
  &mdash;
112
112
  <span class="container">Ionian::Extension::Socket</span>
113
113
 
114
+ <li class="method">
115
+ <a href="Ionian/Socket.html#method-i-expression">#expression</a>
116
+ &mdash;
117
+ <span class="container">Ionian::Socket</span>
118
+
114
119
  <li class="method">
115
120
  <a href="Ionian/Extension/IO.html#method-i-expression">#expression</a>
116
121
  &mdash;
117
122
  <span class="container">Ionian::Extension::IO</span>
118
123
 
124
+ <li class="method">
125
+ <a href="Ionian/Socket.html#method-i-expression-3D">#expression=</a>
126
+ &mdash;
127
+ <span class="container">Ionian::Socket</span>
128
+
119
129
  <li class="method">
120
130
  <a href="Ionian/Extension/IO.html#method-i-expression-3D">#expression=</a>
121
131
  &mdash;
@@ -127,14 +137,14 @@
127
137
  <span class="container">Ionian::Socket</span>
128
138
 
129
139
  <li class="method">
130
- <a href="Ionian/Socket.html#method-i-has_data-3F">#has_data?</a>
140
+ <a href="Ionian/Extension/IO.html#method-i-has_data-3F">#has_data?</a>
131
141
  &mdash;
132
- <span class="container">Ionian::Socket</span>
142
+ <span class="container">Ionian::Extension::IO</span>
133
143
 
134
144
  <li class="method">
135
- <a href="Ionian/Extension/IO.html#method-i-has_data-3F">#has_data?</a>
145
+ <a href="Ionian/Socket.html#method-i-has_data-3F">#has_data?</a>
136
146
  &mdash;
137
- <span class="container">Ionian::Extension::IO</span>
147
+ <span class="container">Ionian::Socket</span>
138
148
 
139
149
  <li class="method">
140
150
  <a href="Ionian/Extension/IO.html#method-i-initialize_ionian">#initialize_ionian</a>
@@ -317,14 +327,14 @@
317
327
  <span class="container">Ionian::Server</span>
318
328
 
319
329
  <li class="method">
320
- <a href="Ionian/Socket.html#method-i-register_observer">#register_observer</a>
330
+ <a href="Ionian/Extension/IO.html#method-i-register_observer">#register_observer</a>
321
331
  &mdash;
322
- <span class="container">Ionian::Socket</span>
332
+ <span class="container">Ionian::Extension::IO</span>
323
333
 
324
334
  <li class="method">
325
- <a href="Ionian/Extension/IO.html#method-i-register_observer">#register_observer</a>
335
+ <a href="Ionian/Socket.html#method-i-register_observer">#register_observer</a>
326
336
  &mdash;
327
- <span class="container">Ionian::Extension::IO</span>
337
+ <span class="container">Ionian::Socket</span>
328
338
 
329
339
  <li class="method">
330
340
  <a href="Ionian/Extension/Socket.html#method-i-reuse_addr">#reuse_addr</a>
@@ -21,7 +21,7 @@ module Ionian
21
21
  def initialize_ionian
22
22
  @ionian_listeners = []
23
23
  @ionian_buf = ''
24
- @ionian_expression = /(.*?)\r?\n?/
24
+ @ionian_expression = /(.*?)[\r\n]+/
25
25
  @ionian_timeout = nil
26
26
  @ionian_skip_select = false
27
27
  @ionian_build_methods = true
@@ -122,8 +122,8 @@ module Ionian
122
122
  end
123
123
  end
124
124
 
125
- # Notify on_match listeners.
126
- @matches.each {|match| notify_listeners match} if notify
125
+ # Notify on_match listeners unless the #run_match thread is active.
126
+ @matches.each {|match| notify_listeners match} if notify and not @match_listener
127
127
 
128
128
  @matches
129
129
  end
data/lib/ionian/socket.rb CHANGED
@@ -4,8 +4,6 @@ module Ionian
4
4
 
5
5
  # A convenient wrapper for TCP, UDP, and Unix client sockets.
6
6
  class Socket
7
- # Returns the regular expression used to match incoming data.
8
- attr_accessor :expression
9
7
 
10
8
  # Creates a new socket or wraps an existing socket.
11
9
  #
@@ -90,6 +88,17 @@ module Ionian
90
88
  attr_reader :protocol
91
89
  alias_method :protocol?, :protocol
92
90
 
91
+ # Returns the regular expression used to match incoming data.
92
+ def expression
93
+ @expression || @socket.expression
94
+ end
95
+
96
+ # Set the regular expression used to match incoming data.
97
+ def expression=(exp)
98
+ @expression = exp
99
+ @socket.expression = exp if @socket
100
+ end
101
+
93
102
  # Returns true if the socket remains open after writing data.
94
103
  def persistent?
95
104
  @persistent == false || @persistent == nil ? false : true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ionian
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex McLain