<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Class: SockIO</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" /> <script type="text/javascript"> // <![CDATA[ function popupCode( url ) { window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") } function toggleCode( id ) { if ( document.getElementById ) elem = document.getElementById( id ); else if ( document.all ) elem = eval( "document.all." + id ); else return false; elemStyle = elem.style; if ( elemStyle.display != "block" ) { elemStyle.display = "block" } else { elemStyle.display = "none" } return true; } // Make codeblocks hidden by default document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) // ]]> </script> </head> <body> <div id="classHeader"> <table class="header-table"> <tr class="top-aligned-row"> <td><strong>Class</strong></td> <td class="class-name-in-header">SockIO</td> </tr> <tr class="top-aligned-row"> <td><strong>In:</strong></td> <td> <a href="../files/lib/network/sockio_rb.html"> lib/network/sockio.rb </a> <br /> </td> </tr> <tr class="top-aligned-row"> <td><strong>Parent:</strong></td> <td> Object </td> </tr> </table> </div> <!-- banner header --> <div id="bodyContent"> <div id="contextContent"> <div id="diagram"> <map id="map" name="map"> <area shape="RECT" coords="31,17,103,65" href="SockIO.html" alt="SockIO "> </map> <img src="../dot/f_30.png" usemap="#map" border=0 alt="TopLevel"> </div> <div id="description"> <p> The <a href="SockIO.html">SockIO</a> class implements the low level interface for TCP sockets. </p> </div> </div> <div id="method-list"> <h3 class="section-bar">Methods</h3> <div class="name-list"> <a href="#M000077">new</a> <a href="#M000078">read</a> <a href="#M000081">read_flush</a> <a href="#M000082">read_urgent</a> <a href="#M000079">write</a> <a href="#M000080">write_flush</a> <a href="#M000083">write_urgent</a> </div> </div> </div> <!-- if includes --> <div id="section"> <!-- if method_list --> <div id="methods"> <h3 class="section-bar">Public Class methods</h3> <div id="method-M000077" class="method-detail"> <a name="M000077"></a> <div class="method-heading"> <a href="SockIO.src/M000077.html" target="Code" class="method-signature" onclick="popupCode('SockIO.src/M000077.html');return false;"> <span class="method-name">new</span><span class="method-args">(sock, bufsize=8192)</span> </a> </div> <div class="method-description"> <p> Creates a new <a href="SockIO.html">SockIO</a> object </p> <dl> <dt><tt>sock</tt></dt><dd>The socket which will be used </dd> <dt><tt>bufsize</tt></dt><dd>The size of the buffer to use (default is 8192) </dd> </dl> </div> </div> <h3 class="section-bar">Public Instance methods</h3> <div id="method-M000078" class="method-detail"> <a name="M000078"></a> <div class="method-heading"> <a href="SockIO.src/M000078.html" target="Code" class="method-signature" onclick="popupCode('SockIO.src/M000078.html');return false;"> <span class="method-name">read</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p> read will receive a data from the socket. </p> <dl> <dt><tt>return</tt></dt><dd>The data read </dd> <dt><tt>IOError</tt></dt><dd>A sockets error occurred. </dd> <dt><tt>EOFError</tt></dt><dd>The connection has closed normally. </dd> </dl> </div> </div> <div id="method-M000081" class="method-detail"> <a name="M000081"></a> <div class="method-heading"> <a href="SockIO.src/M000081.html" target="Code" class="method-signature" onclick="popupCode('SockIO.src/M000081.html');return false;"> <span class="method-name">read_flush</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p> <a href="SockIO.html#M000081">read_flush</a> will kill the input buffer </p> </div> </div> <div id="method-M000082" class="method-detail"> <a name="M000082"></a> <div class="method-heading"> <a href="SockIO.src/M000082.html" target="Code" class="method-signature" onclick="popupCode('SockIO.src/M000082.html');return false;"> <span class="method-name">read_urgent</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p> <a href="SockIO.html#M000082">read_urgent</a> will receive urgent data from the socket. </p> <dl> <dt><tt>return</tt></dt><dd>The data read </dd> <dt><tt>IOError</tt></dt><dd>A sockets error occurred. </dd> <dt><tt>EOFError</tt></dt><dd>The connection has closed normally. </dd> </dl> </div> </div> <div id="method-M000079" class="method-detail"> <a name="M000079"></a> <div class="method-heading"> <a href="SockIO.src/M000079.html" target="Code" class="method-signature" onclick="popupCode('SockIO.src/M000079.html');return false;"> <span class="method-name">write</span><span class="method-args">(msg)</span> </a> </div> <div class="method-description"> <p> write will transmit a message to the socket </p> <dl> <dt><tt>msg</tt></dt><dd>The message string to be sent. </dd> <dt><tt>return</tt></dt><dd>false if more data to be written, true if all data written </dd> <dt><tt>IOError</tt></dt><dd>A sockets error occurred. </dd> <dt><tt>EOFError</tt></dt><dd>The connection has closed normally. </dd> </dl> </div> </div> <div id="method-M000080" class="method-detail"> <a name="M000080"></a> <div class="method-heading"> <a href="SockIO.src/M000080.html" target="Code" class="method-signature" onclick="popupCode('SockIO.src/M000080.html');return false;"> <span class="method-name">write_flush</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p> <a href="SockIO.html#M000080">write_flush</a> will kill the output buffer </p> </div> </div> <div id="method-M000083" class="method-detail"> <a name="M000083"></a> <div class="method-heading"> <a href="SockIO.src/M000083.html" target="Code" class="method-signature" onclick="popupCode('SockIO.src/M000083.html');return false;"> <span class="method-name">write_urgent</span><span class="method-args">(msg)</span> </a> </div> <div class="method-description"> <p> <a href="SockIO.html#M000083">write_urgent</a> will write urgent data to the socket. </p> <dl> <dt><tt>msg</tt></dt><dd>The message string to be sent. </dd> <dt><tt>IOError</tt></dt><dd>A sockets error occurred. </dd> <dt><tt>EOFError</tt></dt><dd>The connection has closed normally. </dd> </dl> </div> </div> </div> </div> <div id="validator-badges"> <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> </div> </body> </html>