mudsock.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html><head><title>Python: mudsock</title>
  3. </head><body bgcolor="#f0f0f8">
  4. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
  5. <tr bgcolor="#7799ee">
  6. <td valign=bottom>&nbsp;<br>
  7. <font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>mudsock</strong></big></big></font></td
  8. ><td align=right valign=bottom
  9. ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br>(built-in)</font></td></tr></table>
  10. <p><tt>Contains&nbsp;the&nbsp;Python&nbsp;wrapper&nbsp;for&nbsp;sockets,&nbsp;and&nbsp;utilities&nbsp;for&nbsp;listing<br>
  11. currently&nbsp;connected&nbsp;sockets.</tt></p>
  12. <p>
  13. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
  14. <tr bgcolor="#ee77aa">
  15. <td colspan=3 valign=bottom>&nbsp;<br>
  16. <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
  17. <tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
  18. <td width="100%"><dl>
  19. <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
  20. </font></dt><dd>
  21. <dl>
  22. <dt><font face="helvetica, arial"><a href="mudsock.html#Mudsock">Mudsock</a>
  23. </font></dt></dl>
  24. </dd>
  25. </dl>
  26. <p>
  27. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
  28. <tr bgcolor="#ffc8d8">
  29. <td colspan=3 valign=bottom>&nbsp;<br>
  30. <font color="#000000" face="helvetica, arial"><a name="Mudsock">class <strong>Mudsock</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
  31. <tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
  32. <td colspan=2><tt>Python&nbsp;Socket&nbsp;<a href="__builtin__.html#object">object</a><br>&nbsp;</tt></td></tr>
  33. <tr><td>&nbsp;</td>
  34. <td width="100%">Methods defined here:<br>
  35. <dl><dt><a name="Mudsock-__cmp__"><strong>__cmp__</strong></a>(...)</dt><dd><tt>x.<a href="#Mudsock-__cmp__">__cmp__</a>(y)&nbsp;&lt;==&gt;&nbsp;cmp(x,y)</tt></dd></dl>
  36. <dl><dt><a name="Mudsock-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#Mudsock-__init__">__init__</a>(...)&nbsp;initializes&nbsp;x;&nbsp;see&nbsp;x.__class__.__doc__&nbsp;for&nbsp;signature</tt></dd></dl>
  37. <dl><dt><a name="Mudsock-aux"><strong>aux</strong></a>(...)</dt><dd><tt>Alias&nbsp;for&nbsp;mudsock.<a href="#Mudsock">Mudsock</a>.getAuxiliary</tt></dd></dl>
  38. <dl><dt><a name="Mudsock-bust_prompt"><strong>bust_prompt</strong></a>(...)</dt><dd><tt><a href="#Mudsock-bust_prompt">bust_prompt</a>()<br>
  39. &nbsp;<br>
  40. Busts&nbsp;the&nbsp;socket's&nbsp;prompt&nbsp;so&nbsp;it&nbsp;will&nbsp;be&nbsp;displayed&nbsp;next&nbsp;pulse.</tt></dd></dl>
  41. <dl><dt><a name="Mudsock-close"><strong>close</strong></a>(...)</dt><dd><tt><a href="#Mudsock-close">close</a>()<br>
  42. &nbsp;<br>
  43. Closes&nbsp;the&nbsp;socket's&nbsp;connection.</tt></dd></dl>
  44. <dl><dt><a name="Mudsock-edit_text"><strong>edit_text</strong></a>(...)</dt><dd><tt><a href="#Mudsock-edit_text">edit_text</a>(dflt_value,&nbsp;on_complete,&nbsp;mode='text')<br>
  45. &nbsp;<br>
  46. Enter&nbsp;the&nbsp;text&nbsp;editor,&nbsp;and&nbsp;set&nbsp;its&nbsp;default&nbsp;value.&nbsp;When&nbsp;the&nbsp;text&nbsp;editor<br>
  47. is&nbsp;edited,&nbsp;call&nbsp;on_complete.&nbsp;This&nbsp;function&nbsp;should&nbsp;take&nbsp;two&nbsp;arguments:<br>
  48. the&nbsp;socket&nbsp;doing&nbsp;the&nbsp;editing,&nbsp;and&nbsp;the&nbsp;output&nbsp;of&nbsp;the&nbsp;editor.&nbsp;Mode&nbsp;can<br>
  49. be&nbsp;'text'&nbsp;or&nbsp;'script'.</tt></dd></dl>
  50. <dl><dt><a name="Mudsock-getAuxiliary"><strong>getAuxiliary</strong></a>(...)</dt><dd><tt><a href="#Mudsock-getAuxiliary">getAuxiliary</a>(name)<br>
  51. &nbsp;<br>
  52. Returns&nbsp;socket's&nbsp;auxiliary&nbsp;data&nbsp;of&nbsp;the&nbsp;specified&nbsp;name.</tt></dd></dl>
  53. <dl><dt><a name="Mudsock-pop_ih"><strong>pop_ih</strong></a>(...)</dt><dd><tt><a href="#Mudsock-pop_ih">pop_ih</a>()<br>
  54. &nbsp;<br>
  55. Pops&nbsp;the&nbsp;socket's&nbsp;current&nbsp;input&nbsp;handler&nbsp;from&nbsp;its&nbsp;input&nbsp;handler&nbsp;stack.</tt></dd></dl>
  56. <dl><dt><a name="Mudsock-push_ih"><strong>push_ih</strong></a>(...)</dt><dd><tt><a href="#Mudsock-push_ih">push_ih</a>(handler_func,&nbsp;prompt_func,&nbsp;state=None)<br>
  57. &nbsp;<br>
  58. Pushes&nbsp;a&nbsp;new&nbsp;input&nbsp;handler&nbsp;and&nbsp;prompt&nbsp;pair&nbsp;onto&nbsp;the&nbsp;socket's&nbsp;input<br>
  59. handler&nbsp;stack.&nbsp;Optionally,&nbsp;a&nbsp;(String)&nbsp;state&nbsp;value&nbsp;can&nbsp;be&nbsp;supplied.<br>
  60. Input&nbsp;handlers&nbsp;take&nbsp;two&nbsp;arguments:&nbsp;the&nbsp;socket&nbsp;and&nbsp;a&nbsp;string&nbsp;command.<br>
  61. Prompts&nbsp;take&nbsp;one&nbsp;argument:&nbsp;the&nbsp;socket.&nbsp;They&nbsp;should&nbsp;send&nbsp;the&nbsp;relevant<br>
  62. text&nbsp;for&nbsp;the&nbsp;prompt&nbsp;to&nbsp;the&nbsp;socket.</tt></dd></dl>
  63. <dl><dt><a name="Mudsock-replace_ih"><strong>replace_ih</strong></a>(...)</dt><dd><tt>repalce_ih(handler_func,&nbsp;prompt_func,&nbsp;state=None)<br>
  64. &nbsp;<br>
  65. Calls&nbsp;pop_ih,&nbsp;followed&nbsp;by&nbsp;push_ih.</tt></dd></dl>
  66. <dl><dt><a name="Mudsock-send"><strong>send</strong></a>(...)</dt><dd><tt><a href="#Mudsock-send">send</a>(mssg,&nbsp;dict&nbsp;=&nbsp;None,&nbsp;newline&nbsp;=&nbsp;True)<br>
  67. &nbsp;<br>
  68. Sends&nbsp;message&nbsp;to&nbsp;the&nbsp;socket.&nbsp;Messages&nbsp;can&nbsp;have&nbsp;scripts&nbsp;embedded&nbsp;in<br>
  69. them,&nbsp;using&nbsp;[&nbsp;and&nbsp;].&nbsp;If&nbsp;so,&nbsp;a&nbsp;variable&nbsp;dictionary&nbsp;must&nbsp;be&nbsp;provided.&nbsp;By<br>
  70. default,&nbsp;'me'&nbsp;references&nbsp;the&nbsp;socket&nbsp;being&nbsp;sent&nbsp;the&nbsp;message.</tt></dd></dl>
  71. <dl><dt><a name="Mudsock-send_raw"><strong>send_raw</strong></a>(...)</dt><dd><tt><a href="#Mudsock-send_raw">send_raw</a>(mssg)<br>
  72. &nbsp;<br>
  73. Sends&nbsp;text&nbsp;to&nbsp;the&nbsp;socket.&nbsp;No&nbsp;appended&nbsp;newline.</tt></dd></dl>
  74. <hr>
  75. Data descriptors defined here:<br>
  76. <dl><dt><strong>account</strong></dt>
  77. <dd><tt>The&nbsp;account&nbsp;currently&nbsp;attached&nbsp;to&nbsp;the&nbsp;socket,&nbsp;or&nbsp;None.&nbsp;Immutable.<br>
  78. see&nbsp;mudsys.attach_account_socket&nbsp;for&nbsp;connecting&nbsp;sockets&nbsp;and&nbsp;accounts.</tt></dd>
  79. </dl>
  80. <dl><dt><strong>can_use</strong></dt>
  81. <dd><tt>True&nbsp;or&nbsp;False&nbsp;if&nbsp;the&nbsp;socket&nbsp;is&nbsp;ready&nbsp;for&nbsp;use.&nbsp;Socket&nbsp;becomes&nbsp;available<br>
  82. after&nbsp;its&nbsp;dns&nbsp;addresss&nbsp;resolves.&nbsp;Immutable.</tt></dd>
  83. </dl>
  84. <dl><dt><strong>ch</strong></dt>
  85. <dd><tt>Alias&nbsp;for&nbsp;mudsock.Mudsock.character.</tt></dd>
  86. </dl>
  87. <dl><dt><strong>char</strong></dt>
  88. <dd><tt>Alias&nbsp;for&nbsp;mudsock.Mudsock.character</tt></dd>
  89. </dl>
  90. <dl><dt><strong>character</strong></dt>
  91. <dd><tt>The&nbsp;character&nbsp;currently&nbsp;attached&nbsp;to&nbsp;the&nbsp;socket,&nbsp;on&nbsp;None.&nbsp;Immutable.<br>
  92. see&nbsp;mudsys.attach_char_socket&nbsp;for&nbsp;connecting&nbsp;characters&nbsp;to&nbsp;account.</tt></dd>
  93. </dl>
  94. <dl><dt><strong>has_input</strong></dt>
  95. <dd><tt>True&nbsp;or&nbsp;False&nbsp;if&nbsp;the&nbsp;socket&nbsp;has&nbsp;any&nbsp;input&nbsp;pending.&nbsp;Immutable.</tt></dd>
  96. </dl>
  97. <dl><dt><strong>hostname</strong></dt>
  98. <dd><tt>The&nbsp;dns&nbsp;address&nbsp;that&nbsp;the&nbsp;socket&nbsp;is&nbsp;connected&nbsp;from.&nbsp;Immutable.</tt></dd>
  99. </dl>
  100. <dl><dt><strong>idle_time</strong></dt>
  101. <dd><tt>How&nbsp;long&nbsp;(in&nbsp;seconds)&nbsp;the&nbsp;socket's&nbsp;input&nbsp;handler&nbsp;has&nbsp;been&nbsp;idle&nbsp;for.&nbsp;Immutable.</tt></dd>
  102. </dl>
  103. <dl><dt><strong>outbound_text</strong></dt>
  104. <dd><tt>The&nbsp;socket's&nbsp;outbound&nbsp;text.</tt></dd>
  105. </dl>
  106. <dl><dt><strong>state</strong></dt>
  107. <dd><tt>The&nbsp;state&nbsp;that&nbsp;the&nbsp;socket&nbsp;is&nbsp;in.&nbsp;Immutable.&nbsp;For&nbsp;more&nbsp;on&nbsp;states&nbsp;see<br>
  108. mudsock.Mudsock.push_ih</tt></dd>
  109. </dl>
  110. <dl><dt><strong>uid</strong></dt>
  111. <dd><tt>The&nbsp;socket's&nbsp;uid.&nbsp;Immutable.</tt></dd>
  112. </dl>
  113. <hr>
  114. Data and other attributes defined here:<br>
  115. <dl><dt><strong>__new__</strong> = &lt;built-in method __new__ of type object at 0x6f980&gt;<dd><tt>T.<a href="#Mudsock-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;T</tt></dl>
  116. </td></tr></table></td></tr></table><p>
  117. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
  118. <tr bgcolor="#eeaa77">
  119. <td colspan=3 valign=bottom>&nbsp;<br>
  120. <font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
  121. <tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
  122. <td width="100%"><dl><dt><a name="-socket_list"><strong>socket_list</strong></a>(...)</dt><dd><tt><a href="#-socket_list">socket_list</a>()<br>
  123. &nbsp;<br>
  124. Returns&nbsp;a&nbsp;list&nbsp;of&nbsp;all&nbsp;sockets&nbsp;currently&nbsp;connected.</tt></dd></dl>
  125. </td></tr></table>
  126. </body></html>