passenger 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (243) hide show
  1. data/Rakefile +2 -1
  2. data/doc/Security of user switching support.html +1 -1
  3. data/doc/Users guide.html +1 -1
  4. data/ext/apache2/ApplicationPoolServerExecutable.cpp +4 -2
  5. data/ext/apache2/Bucket.cpp +104 -0
  6. data/ext/apache2/Bucket.h +36 -0
  7. data/ext/apache2/Configuration.h +1 -1
  8. data/ext/apache2/Hooks.cpp +2 -5
  9. data/ext/apache2/Utils.h +1 -1
  10. data/ext/boost/non_type.hpp +27 -0
  11. metadata +7 -247
  12. data/doc/Architectural overview.html +0 -740
  13. data/doc/cxxapi/ApplicationPoolServer_8h-source.html +0 -677
  14. data/doc/cxxapi/ApplicationPool_8h-source.html +0 -212
  15. data/doc/cxxapi/Application_8h-source.html +0 -448
  16. data/doc/cxxapi/Configuration_8h-source.html +0 -180
  17. data/doc/cxxapi/DummySpawnManager_8h-source.html +0 -126
  18. data/doc/cxxapi/Exceptions_8h-source.html +0 -244
  19. data/doc/cxxapi/Hooks_8h-source.html +0 -63
  20. data/doc/cxxapi/Logging_8h-source.html +0 -136
  21. data/doc/cxxapi/MessageChannel_8h-source.html +0 -524
  22. data/doc/cxxapi/SpawnManager_8h-source.html +0 -593
  23. data/doc/cxxapi/StandardApplicationPool_8h-source.html +0 -713
  24. data/doc/cxxapi/System_8h-source.html +0 -251
  25. data/doc/cxxapi/Utils_8h-source.html +0 -283
  26. data/doc/cxxapi/annotated.html +0 -59
  27. data/doc/cxxapi/classClient-members.html +0 -35
  28. data/doc/cxxapi/classClient.html +0 -117
  29. data/doc/cxxapi/classDirectoryMapper-members.html +0 -38
  30. data/doc/cxxapi/classDirectoryMapper.html +0 -203
  31. data/doc/cxxapi/classHooks-members.html +0 -33
  32. data/doc/cxxapi/classHooks.html +0 -43
  33. data/doc/cxxapi/classPassenger_1_1Application-members.html +0 -38
  34. data/doc/cxxapi/classPassenger_1_1Application.html +0 -229
  35. data/doc/cxxapi/classPassenger_1_1ApplicationPool-members.html +0 -40
  36. data/doc/cxxapi/classPassenger_1_1ApplicationPool.html +0 -331
  37. data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer-members.html +0 -36
  38. data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer.html +0 -225
  39. data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.map +0 -1
  40. data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.md5 +0 -1
  41. data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.png +0 -0
  42. data/doc/cxxapi/classPassenger_1_1Application_1_1Session-members.html +0 -43
  43. data/doc/cxxapi/classPassenger_1_1Application_1_1Session.html +0 -329
  44. data/doc/cxxapi/classPassenger_1_1BusyException-members.html +0 -33
  45. data/doc/cxxapi/classPassenger_1_1BusyException.html +0 -47
  46. data/doc/cxxapi/classPassenger_1_1ConfigurationException-members.html +0 -33
  47. data/doc/cxxapi/classPassenger_1_1ConfigurationException.html +0 -44
  48. data/doc/cxxapi/classPassenger_1_1DummySpawnManager-members.html +0 -33
  49. data/doc/cxxapi/classPassenger_1_1DummySpawnManager.html +0 -51
  50. data/doc/cxxapi/classPassenger_1_1FileNotFoundException-members.html +0 -33
  51. data/doc/cxxapi/classPassenger_1_1FileNotFoundException.html +0 -51
  52. data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.map +0 -1
  53. data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.md5 +0 -1
  54. data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.png +0 -0
  55. data/doc/cxxapi/classPassenger_1_1FileSystemException-members.html +0 -38
  56. data/doc/cxxapi/classPassenger_1_1FileSystemException.html +0 -61
  57. data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.map +0 -1
  58. data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.md5 +0 -1
  59. data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.png +0 -0
  60. data/doc/cxxapi/classPassenger_1_1IOException-members.html +0 -33
  61. data/doc/cxxapi/classPassenger_1_1IOException.html +0 -54
  62. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.map +0 -1
  63. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.md5 +0 -1
  64. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.png +0 -0
  65. data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +0 -47
  66. data/doc/cxxapi/classPassenger_1_1MessageChannel.html +0 -591
  67. data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +0 -35
  68. data/doc/cxxapi/classPassenger_1_1SpawnException.html +0 -77
  69. data/doc/cxxapi/classPassenger_1_1SpawnManager-members.html +0 -37
  70. data/doc/cxxapi/classPassenger_1_1SpawnManager.html +0 -255
  71. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool-members.html +0 -42
  72. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool.html +0 -372
  73. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.map +0 -1
  74. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.md5 +0 -1
  75. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.png +0 -0
  76. data/doc/cxxapi/classPassenger_1_1SystemException-members.html +0 -37
  77. data/doc/cxxapi/classPassenger_1_1SystemException.html +0 -154
  78. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.map +0 -1
  79. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.md5 +0 -1
  80. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.png +0 -0
  81. data/doc/cxxapi/classPassenger_1_1TempFile-members.html +0 -36
  82. data/doc/cxxapi/classPassenger_1_1TempFile.html +0 -128
  83. data/doc/cxxapi/classPassenger_1_1Thread-members.html +0 -35
  84. data/doc/cxxapi/classPassenger_1_1Thread.html +0 -100
  85. data/doc/cxxapi/classboost_1_1this__thread_1_1disable__syscall__interruption-members.html +0 -33
  86. data/doc/cxxapi/classboost_1_1this__thread_1_1disable__syscall__interruption.html +0 -46
  87. data/doc/cxxapi/classboost_1_1this__thread_1_1enable__syscall__interruption-members.html +0 -33
  88. data/doc/cxxapi/classboost_1_1this__thread_1_1enable__syscall__interruption.html +0 -44
  89. data/doc/cxxapi/classboost_1_1this__thread_1_1restore__syscall__interruption-members.html +0 -33
  90. data/doc/cxxapi/classboost_1_1this__thread_1_1restore__syscall__interruption.html +0 -44
  91. data/doc/cxxapi/definitions_8h-source.html +0 -28
  92. data/doc/cxxapi/doxygen.css +0 -433
  93. data/doc/cxxapi/doxygen.png +0 -0
  94. data/doc/cxxapi/files.html +0 -41
  95. data/doc/cxxapi/ftv2blank.png +0 -0
  96. data/doc/cxxapi/ftv2doc.png +0 -0
  97. data/doc/cxxapi/ftv2folderclosed.png +0 -0
  98. data/doc/cxxapi/ftv2folderopen.png +0 -0
  99. data/doc/cxxapi/ftv2lastnode.png +0 -0
  100. data/doc/cxxapi/ftv2link.png +0 -0
  101. data/doc/cxxapi/ftv2mlastnode.png +0 -0
  102. data/doc/cxxapi/ftv2mnode.png +0 -0
  103. data/doc/cxxapi/ftv2node.png +0 -0
  104. data/doc/cxxapi/ftv2plastnode.png +0 -0
  105. data/doc/cxxapi/ftv2pnode.png +0 -0
  106. data/doc/cxxapi/ftv2vertline.png +0 -0
  107. data/doc/cxxapi/functions.html +0 -212
  108. data/doc/cxxapi/functions_func.html +0 -207
  109. data/doc/cxxapi/functions_type.html +0 -46
  110. data/doc/cxxapi/functions_vars.html +0 -48
  111. data/doc/cxxapi/graph_legend.dot +0 -22
  112. data/doc/cxxapi/graph_legend.html +0 -87
  113. data/doc/cxxapi/graph_legend.png +0 -0
  114. data/doc/cxxapi/group__Configuration.html +0 -236
  115. data/doc/cxxapi/group__Configuration.png +0 -0
  116. data/doc/cxxapi/group__Core.html +0 -51
  117. data/doc/cxxapi/group__Core.png +0 -0
  118. data/doc/cxxapi/group__Exceptions.html +0 -43
  119. data/doc/cxxapi/group__Hooks.html +0 -46
  120. data/doc/cxxapi/group__Hooks.png +0 -0
  121. data/doc/cxxapi/group__Support.html +0 -406
  122. data/doc/cxxapi/hierarchy.html +0 -67
  123. data/doc/cxxapi/index.html +0 -11
  124. data/doc/cxxapi/inherit__graph__0.map +0 -1
  125. data/doc/cxxapi/inherit__graph__0.md5 +0 -1
  126. data/doc/cxxapi/inherit__graph__0.png +0 -0
  127. data/doc/cxxapi/inherit__graph__1.map +0 -1
  128. data/doc/cxxapi/inherit__graph__1.md5 +0 -1
  129. data/doc/cxxapi/inherit__graph__1.png +0 -0
  130. data/doc/cxxapi/inherit__graph__10.map +0 -1
  131. data/doc/cxxapi/inherit__graph__10.md5 +0 -1
  132. data/doc/cxxapi/inherit__graph__10.png +0 -0
  133. data/doc/cxxapi/inherit__graph__11.map +0 -1
  134. data/doc/cxxapi/inherit__graph__11.md5 +0 -1
  135. data/doc/cxxapi/inherit__graph__11.png +0 -0
  136. data/doc/cxxapi/inherit__graph__12.map +0 -1
  137. data/doc/cxxapi/inherit__graph__12.md5 +0 -1
  138. data/doc/cxxapi/inherit__graph__12.png +0 -0
  139. data/doc/cxxapi/inherit__graph__13.map +0 -1
  140. data/doc/cxxapi/inherit__graph__13.md5 +0 -1
  141. data/doc/cxxapi/inherit__graph__13.png +0 -0
  142. data/doc/cxxapi/inherit__graph__14.map +0 -2
  143. data/doc/cxxapi/inherit__graph__14.md5 +0 -1
  144. data/doc/cxxapi/inherit__graph__14.png +0 -0
  145. data/doc/cxxapi/inherit__graph__15.map +0 -1
  146. data/doc/cxxapi/inherit__graph__15.md5 +0 -1
  147. data/doc/cxxapi/inherit__graph__15.png +0 -0
  148. data/doc/cxxapi/inherit__graph__16.map +0 -1
  149. data/doc/cxxapi/inherit__graph__16.md5 +0 -1
  150. data/doc/cxxapi/inherit__graph__16.png +0 -0
  151. data/doc/cxxapi/inherit__graph__17.map +0 -1
  152. data/doc/cxxapi/inherit__graph__17.md5 +0 -1
  153. data/doc/cxxapi/inherit__graph__17.png +0 -0
  154. data/doc/cxxapi/inherit__graph__2.map +0 -1
  155. data/doc/cxxapi/inherit__graph__2.md5 +0 -1
  156. data/doc/cxxapi/inherit__graph__2.png +0 -0
  157. data/doc/cxxapi/inherit__graph__3.map +0 -1
  158. data/doc/cxxapi/inherit__graph__3.md5 +0 -1
  159. data/doc/cxxapi/inherit__graph__3.png +0 -0
  160. data/doc/cxxapi/inherit__graph__4.map +0 -1
  161. data/doc/cxxapi/inherit__graph__4.md5 +0 -1
  162. data/doc/cxxapi/inherit__graph__4.png +0 -0
  163. data/doc/cxxapi/inherit__graph__5.map +0 -1
  164. data/doc/cxxapi/inherit__graph__5.md5 +0 -1
  165. data/doc/cxxapi/inherit__graph__5.png +0 -0
  166. data/doc/cxxapi/inherit__graph__6.map +0 -1
  167. data/doc/cxxapi/inherit__graph__6.md5 +0 -1
  168. data/doc/cxxapi/inherit__graph__6.png +0 -0
  169. data/doc/cxxapi/inherit__graph__7.map +0 -1
  170. data/doc/cxxapi/inherit__graph__7.md5 +0 -1
  171. data/doc/cxxapi/inherit__graph__7.png +0 -0
  172. data/doc/cxxapi/inherit__graph__8.map +0 -1
  173. data/doc/cxxapi/inherit__graph__8.md5 +0 -1
  174. data/doc/cxxapi/inherit__graph__8.png +0 -0
  175. data/doc/cxxapi/inherit__graph__9.map +0 -2
  176. data/doc/cxxapi/inherit__graph__9.md5 +0 -1
  177. data/doc/cxxapi/inherit__graph__9.png +0 -0
  178. data/doc/cxxapi/inherits.html +0 -102
  179. data/doc/cxxapi/main.html +0 -27
  180. data/doc/cxxapi/modules.html +0 -34
  181. data/doc/cxxapi/namespacePassenger.html +0 -208
  182. data/doc/cxxapi/namespacePassenger_1_1InterruptableCalls.html +0 -43
  183. data/doc/cxxapi/namespacemembers.html +0 -70
  184. data/doc/cxxapi/namespacemembers_func.html +0 -66
  185. data/doc/cxxapi/namespacemembers_type.html +0 -46
  186. data/doc/cxxapi/namespaces.html +0 -35
  187. data/doc/cxxapi/structPassenger_1_1AnythingToString-members.html +0 -33
  188. data/doc/cxxapi/structPassenger_1_1AnythingToString.html +0 -49
  189. data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4-members.html +0 -33
  190. data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4.html +0 -49
  191. data/doc/cxxapi/tab_b.gif +0 -0
  192. data/doc/cxxapi/tab_l.gif +0 -0
  193. data/doc/cxxapi/tab_r.gif +0 -0
  194. data/doc/cxxapi/tabs.css +0 -102
  195. data/doc/cxxapi/tree.html +0 -166
  196. data/doc/rdoc/classes/ConditionVariable.html +0 -160
  197. data/doc/rdoc/classes/Exception.html +0 -120
  198. data/doc/rdoc/classes/GC.html +0 -113
  199. data/doc/rdoc/classes/IO.html +0 -150
  200. data/doc/rdoc/classes/Passenger.html +0 -136
  201. data/doc/rdoc/classes/Passenger/AbstractRequestHandler.html +0 -401
  202. data/doc/rdoc/classes/Passenger/AbstractServer.html +0 -649
  203. data/doc/rdoc/classes/Passenger/AbstractServer/ServerAlreadyStarted.html +0 -97
  204. data/doc/rdoc/classes/Passenger/AbstractServer/ServerError.html +0 -96
  205. data/doc/rdoc/classes/Passenger/AbstractServer/ServerNotStarted.html +0 -97
  206. data/doc/rdoc/classes/Passenger/AbstractServer/UnknownMessage.html +0 -96
  207. data/doc/rdoc/classes/Passenger/AppInitError.html +0 -137
  208. data/doc/rdoc/classes/Passenger/Application.html +0 -296
  209. data/doc/rdoc/classes/Passenger/ConsoleTextTemplate.html +0 -172
  210. data/doc/rdoc/classes/Passenger/FrameworkInitError.html +0 -143
  211. data/doc/rdoc/classes/Passenger/HTMLTemplate.html +0 -175
  212. data/doc/rdoc/classes/Passenger/InitializationError.html +0 -141
  213. data/doc/rdoc/classes/Passenger/MessageChannel.html +0 -488
  214. data/doc/rdoc/classes/Passenger/NativeSupport.html +0 -320
  215. data/doc/rdoc/classes/Passenger/SpawnManager.html +0 -375
  216. data/doc/rdoc/classes/Passenger/UnknownError.html +0 -125
  217. data/doc/rdoc/classes/Passenger/Utils.html +0 -580
  218. data/doc/rdoc/classes/Passenger/VersionNotFound.html +0 -140
  219. data/doc/rdoc/classes/PlatformInfo.html +0 -292
  220. data/doc/rdoc/classes/RakeExtensions.html +0 -197
  221. data/doc/rdoc/created.rid +0 -1
  222. data/doc/rdoc/files/DEVELOPERS_TXT.html +0 -230
  223. data/doc/rdoc/files/README.html +0 -150
  224. data/doc/rdoc/files/ext/passenger/native_support_c.html +0 -92
  225. data/doc/rdoc/files/lib/passenger/abstract_request_handler_rb.html +0 -125
  226. data/doc/rdoc/files/lib/passenger/abstract_server_rb.html +0 -127
  227. data/doc/rdoc/files/lib/passenger/application_rb.html +0 -123
  228. data/doc/rdoc/files/lib/passenger/console_text_template_rb.html +0 -122
  229. data/doc/rdoc/files/lib/passenger/constants_rb.html +0 -114
  230. data/doc/rdoc/files/lib/passenger/dependencies_rb.html +0 -130
  231. data/doc/rdoc/files/lib/passenger/exceptions_rb.html +0 -118
  232. data/doc/rdoc/files/lib/passenger/html_template_rb.html +0 -122
  233. data/doc/rdoc/files/lib/passenger/message_channel_rb.html +0 -118
  234. data/doc/rdoc/files/lib/passenger/platform_info_rb.html +0 -122
  235. data/doc/rdoc/files/lib/passenger/simple_benchmarking_rb.html +0 -118
  236. data/doc/rdoc/files/lib/passenger/spawn_manager_rb.html +0 -139
  237. data/doc/rdoc/files/lib/passenger/utils_rb.html +0 -130
  238. data/doc/rdoc/files/lib/rake/extensions_rb.html +0 -122
  239. data/doc/rdoc/fr_class_index.html +0 -71
  240. data/doc/rdoc/fr_file_index.html +0 -63
  241. data/doc/rdoc/fr_method_index.html +0 -120
  242. data/doc/rdoc/index.html +0 -26
  243. data/doc/rdoc/rdoc-style.css +0 -187
@@ -1,649 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
- <html>
6
- <head>
7
- <title>Class: Passenger::AbstractServer</title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
10
-
11
- <script language="JavaScript" type="text/javascript">
12
- // <![CDATA[
13
-
14
- function toggleSource( id )
15
- {
16
- var elem
17
- var link
18
-
19
- if( document.getElementById )
20
- {
21
- elem = document.getElementById( id )
22
- link = document.getElementById( "l_" + id )
23
- }
24
- else if ( document.all )
25
- {
26
- elem = eval( "document.all." + id )
27
- link = eval( "document.all.l_" + id )
28
- }
29
- else
30
- return false;
31
-
32
- if( elem.style.display == "block" )
33
- {
34
- elem.style.display = "none"
35
- link.innerHTML = "show source"
36
- }
37
- else
38
- {
39
- elem.style.display = "block"
40
- link.innerHTML = "hide source"
41
- }
42
- }
43
-
44
- function openCode( url )
45
- {
46
- window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
47
- }
48
- // ]]>
49
- </script>
50
- </head>
51
-
52
- <body>
53
- <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
54
- <td class="file-title"><span class="file-title-prefix">Class</span><br />Passenger::AbstractServer</td>
55
- <td align="right">
56
- <table cellspacing="0" cellpadding="2">
57
- <tr valign="top">
58
- <td>In:</td>
59
- <td>
60
- <a href="../../files/lib/passenger/abstract_server_rb.html">lib/passenger/abstract_server.rb</a>
61
- </td>
62
- </tr>
63
- <tr>
64
- <td>Parent:</td>
65
- <td>
66
- Object
67
- </td>
68
- </tr>
69
- </table>
70
- </td>
71
- </tr>
72
- </table>
73
- <!-- banner header -->
74
-
75
- <div id="bodyContent">
76
- <div id="content">
77
-
78
- <div class="description"><p>
79
- An abstract base class for a <a
80
- href="AbstractServer.html#M000063">server</a>, with the following
81
- properties:
82
- </p>
83
- <ul>
84
- <li>The <a href="AbstractServer.html#M000063">server</a> has exactly one <a
85
- href="AbstractServer.html#M000064">client</a>, and is connected to that <a
86
- href="AbstractServer.html#M000064">client</a> at all times. The <a
87
- href="AbstractServer.html#M000063">server</a> will quit when the connection
88
- closes.
89
-
90
- </li>
91
- <li>The <a href="AbstractServer.html#M000063">server</a>&#8216;s main loop may
92
- be run in a child process (and so is asynchronous from the main process).
93
-
94
- </li>
95
- <li>One can communicate with the <a
96
- href="AbstractServer.html#M000063">server</a> through discrete messages (as
97
- opposed to byte streams).
98
-
99
- </li>
100
- <li>The <a href="AbstractServer.html#M000063">server</a> can pass file
101
- descriptors (<a href="../IO.html">IO</a> objects) back to the <a
102
- href="AbstractServer.html#M000064">client</a>.
103
-
104
- </li>
105
- </ul>
106
- <p>
107
- A message is just an ordered list of strings. The first element in the
108
- message is the _message name_.
109
- </p>
110
- <p>
111
- The <a href="AbstractServer.html#M000063">server</a> will also reset all
112
- signal handlers (in the child process). That is, it will respond to all
113
- signals in the default manner. The only exception is SIGHUP, which is
114
- ignored. One may define additional signal handlers using <a
115
- href="AbstractServer.html#M000062">define_signal_handler</a>().
116
- </p>
117
- <p>
118
- Before an <a href="AbstractServer.html">AbstractServer</a> can be used, it
119
- must first be started by calling <a
120
- href="AbstractServer.html#M000053">start</a>(). When it is no longer
121
- needed, <a href="AbstractServer.html#M000055">stop</a>() should be called.
122
- </p>
123
- <p>
124
- Here&#8216;s an example on using <a
125
- href="AbstractServer.html">AbstractServer</a>:
126
- </p>
127
- <pre>
128
- class MyServer &lt; Passenger::AbstractServer
129
- def initialize
130
- super()
131
- define_message_handler(:hello, :handle_hello)
132
- end
133
-
134
- def hello(first_name, last_name)
135
- send_to_server('hello', first_name, last_name)
136
- reply, pointless_number = recv_from_server
137
- puts &quot;The server said: #{reply}&quot;
138
- puts &quot;In addition, it sent this pointless number: #{pointless_number}&quot;
139
- end
140
-
141
- private
142
- def handle_hello(first_name, last_name)
143
- send_to_client(&quot;Hello #{first_name} #{last_name}, how are you?&quot;, 1234)
144
- end
145
- end
146
-
147
- server = MyServer.new
148
- server.start
149
- server.hello(&quot;Joe&quot;, &quot;Dalton&quot;)
150
- server.stop
151
- </pre>
152
- </div>
153
-
154
-
155
-
156
- <div class="sectiontitle">Methods</div>
157
- <ul>
158
- <li><a href="#M000058">before_fork</a></li>
159
- <li><a href="#M000064">client</a></li>
160
- <li><a href="#M000061">define_message_handler</a></li>
161
- <li><a href="#M000062">define_signal_handler</a></li>
162
- <li><a href="#M000060">finalize_server</a></li>
163
- <li><a href="#M000059">initialize_server</a></li>
164
- <li><a href="#M000052">new</a></li>
165
- <li><a href="#M000065">quit_main</a></li>
166
- <li><a href="#M000063">server</a></li>
167
- <li><a href="#M000057">server_pid</a></li>
168
- <li><a href="#M000053">start</a></li>
169
- <li><a href="#M000054">start_synchronously</a></li>
170
- <li><a href="#M000056">started?</a></li>
171
- <li><a href="#M000055">stop</a></li>
172
- </ul>
173
-
174
- <div class="sectiontitle">Included Modules</div>
175
- <ul>
176
- <li><a href="Utils.html">Utils</a></li>
177
- </ul>
178
-
179
-
180
- <div class="sectiontitle">Classes and Modules</div>
181
- Class <a href="AbstractServer/ServerAlreadyStarted.html" class="link">Passenger::AbstractServer::ServerAlreadyStarted</a><br />
182
- Class <a href="AbstractServer/ServerError.html" class="link">Passenger::AbstractServer::ServerError</a><br />
183
- Class <a href="AbstractServer/ServerNotStarted.html" class="link">Passenger::AbstractServer::ServerNotStarted</a><br />
184
- Class <a href="AbstractServer/UnknownMessage.html" class="link">Passenger::AbstractServer::UnknownMessage</a><br />
185
-
186
-
187
- <div class="sectiontitle">Constants</div>
188
- <table border='0' cellpadding='5'>
189
- <tr valign='top'>
190
- <td class="attr-name">SERVER_TERMINATION_SIGNAL</td>
191
- <td>=</td>
192
- <td class="attr-value">&quot;SIGTERM&quot;</td>
193
- </tr>
194
- </table>
195
-
196
-
197
- <div class="sectiontitle">Public Class methods</div>
198
- <div class="method">
199
- <div class="title">
200
- <a name="M000052"></a><b>new</b>()
201
- </div>
202
- <div class="sourcecode">
203
- <p class="source-link">[ <a href="javascript:toggleSource('M000052_source')" id="l_M000052_source">show source</a> ]</p>
204
- <div id="M000052_source" class="dyn-source">
205
- <pre>
206
- <span class="ruby-comment cmt"># File lib/passenger/abstract_server.rb, line 91</span>
207
- 91: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
208
- 92: <span class="ruby-ivar">@done</span> = <span class="ruby-keyword kw">false</span>
209
- 93: <span class="ruby-ivar">@message_handlers</span> = {}
210
- 94: <span class="ruby-ivar">@signal_handlers</span> = {}
211
- 95: <span class="ruby-ivar">@orig_signal_handlers</span> = {}
212
- 96: <span class="ruby-keyword kw">end</span>
213
- </pre>
214
- </div>
215
- </div>
216
- </div>
217
- <div class="sectiontitle">Public Instance methods</div>
218
- <div class="method">
219
- <div class="title">
220
- <a name="M000057"></a><b>server_pid</b>()
221
- </div>
222
- <div class="description">
223
- <p>
224
- Return the PID of the started <a
225
- href="AbstractServer.html#M000063">server</a>. This is only valid if <a
226
- href="AbstractServer.html#M000053">start</a>() has been called.
227
- </p>
228
- </div>
229
- <div class="sourcecode">
230
- <p class="source-link">[ <a href="javascript:toggleSource('M000057_source')" id="l_M000057_source">show source</a> ]</p>
231
- <div id="M000057_source" class="dyn-source">
232
- <pre>
233
- <span class="ruby-comment cmt"># File lib/passenger/abstract_server.rb, line 216</span>
234
- 216: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">server_pid</span>
235
- 217: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@pid</span>
236
- 218: <span class="ruby-keyword kw">end</span>
237
- </pre>
238
- </div>
239
- </div>
240
- </div>
241
- <div class="method">
242
- <div class="title">
243
- <a name="M000053"></a><b>start</b>()
244
- </div>
245
- <div class="description">
246
- <p>
247
- Start the <a href="AbstractServer.html#M000063">server</a>. This method
248
- does not block since the <a href="AbstractServer.html#M000063">server</a>
249
- runs asynchronously from the current process.
250
- </p>
251
- <p>
252
- You may only call this method if the <a
253
- href="AbstractServer.html#M000063">server</a> is not already started.
254
- Otherwise, a <a
255
- href="AbstractServer/ServerAlreadyStarted.html">ServerAlreadyStarted</a>
256
- will be raised.
257
- </p>
258
- <p>
259
- Derived classes may raise additional exceptions.
260
- </p>
261
- </div>
262
- <div class="sourcecode">
263
- <p class="source-link">[ <a href="javascript:toggleSource('M000053_source')" id="l_M000053_source">show source</a> ]</p>
264
- <div id="M000053_source" class="dyn-source">
265
- <pre>
266
- <span class="ruby-comment cmt"># File lib/passenger/abstract_server.rb, line 105</span>
267
- 105: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
268
- 106: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">started?</span>
269
- 107: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ServerAlreadyStarted</span>, <span class="ruby-value str">&quot;Server is already started&quot;</span>
270
- 108: <span class="ruby-keyword kw">end</span>
271
- 109:
272
- 110: <span class="ruby-ivar">@parent_socket</span>, <span class="ruby-ivar">@child_socket</span> = <span class="ruby-constant">UNIXSocket</span>.<span class="ruby-identifier">pair</span>
273
- 111: <span class="ruby-identifier">before_fork</span>
274
- 112: <span class="ruby-ivar">@pid</span> = <span class="ruby-identifier">fork</span> <span class="ruby-keyword kw">do</span>
275
- 113: <span class="ruby-keyword kw">begin</span>
276
- 114: <span class="ruby-constant">STDOUT</span>.<span class="ruby-identifier">sync</span> = <span class="ruby-keyword kw">true</span>
277
- 115: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">sync</span> = <span class="ruby-keyword kw">true</span>
278
- 116: <span class="ruby-ivar">@parent_socket</span>.<span class="ruby-identifier">close</span>
279
- 117:
280
- 118: <span class="ruby-comment cmt"># During Passenger's early days, we used to close file descriptors based</span>
281
- 119: <span class="ruby-comment cmt"># on a white list of file descriptors. That proved to be way too fragile:</span>
282
- 120: <span class="ruby-comment cmt"># too many file descriptors are being left open even though they shouldn't</span>
283
- 121: <span class="ruby-comment cmt"># be. So now we close file descriptors based on a black list.</span>
284
- 122: <span class="ruby-identifier">file_descriptors_to_close</span> = [<span class="ruby-value">0</span>, <span class="ruby-value">1</span>, <span class="ruby-value">2</span>, <span class="ruby-ivar">@child_socket</span>.<span class="ruby-identifier">fileno</span>]
285
- 123: <span class="ruby-constant">NativeSupport</span>.<span class="ruby-identifier">close_all_file_descriptors</span>(<span class="ruby-identifier">file_descriptors_to_close</span>)
286
- 124: <span class="ruby-comment cmt"># In addition to closing the file descriptors, one must also close</span>
287
- 125: <span class="ruby-comment cmt"># the associated IO objects. This is to prevent IO.close from</span>
288
- 126: <span class="ruby-comment cmt"># double-closing already closed file descriptors.</span>
289
- 127: <span class="ruby-identifier">close_all_io_objects_for_fds</span>(<span class="ruby-constant">Set</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">file_descriptors_to_close</span>))
290
- 128:
291
- 129: <span class="ruby-comment cmt"># At this point, RubyGems might have open file handles for which</span>
292
- 130: <span class="ruby-comment cmt"># the associated file descriptors have just been closed. This can</span>
293
- 131: <span class="ruby-comment cmt"># result in mysterious 'EBADFD' errors. So we force RubyGems to</span>
294
- 132: <span class="ruby-comment cmt"># clear all open file handles.</span>
295
- 133: <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">clear_paths</span>
296
- 134:
297
- 135: <span class="ruby-identifier">start_synchronously</span>(<span class="ruby-ivar">@child_socket</span>)
298
- 136: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Interrupt</span>
299
- 137: <span class="ruby-comment cmt"># Do nothing.</span>
300
- 138: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">SignalException</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">signal</span>
301
- 139: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">signal</span>.<span class="ruby-identifier">message</span> <span class="ruby-operator">==</span> <span class="ruby-constant">SERVER_TERMINATION_SIGNAL</span>
302
- 140: <span class="ruby-comment cmt"># Do nothing.</span>
303
- 141: <span class="ruby-keyword kw">else</span>
304
- 142: <span class="ruby-identifier">print_exception</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">signal</span>)
305
- 143: <span class="ruby-keyword kw">end</span>
306
- 144: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
307
- 145: <span class="ruby-identifier">print_exception</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">e</span>)
308
- 146: <span class="ruby-keyword kw">ensure</span>
309
- 147: <span class="ruby-identifier">exit!</span>
310
- 148: <span class="ruby-keyword kw">end</span>
311
- 149: <span class="ruby-keyword kw">end</span>
312
- 150: <span class="ruby-ivar">@child_socket</span>.<span class="ruby-identifier">close</span>
313
- 151: <span class="ruby-ivar">@parent_channel</span> = <span class="ruby-constant">MessageChannel</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@parent_socket</span>)
314
- 152: <span class="ruby-keyword kw">end</span>
315
- </pre>
316
- </div>
317
- </div>
318
- </div>
319
- <div class="method">
320
- <div class="title">
321
- <a name="M000054"></a><b>start_synchronously</b>(socket)
322
- </div>
323
- <div class="description">
324
- <p>
325
- Start the <a href="AbstractServer.html#M000063">server</a>, but in the
326
- current process instead of in a child process. This method blocks until the
327
- <a href="AbstractServer.html#M000063">server</a>&#8216;s main loop has
328
- ended.
329
- </p>
330
- <p>
331
- <em>socket</em> is the socket that the <a
332
- href="AbstractServer.html#M000063">server</a> should listen on. The <a
333
- href="AbstractServer.html#M000063">server</a> main loop will end if the
334
- socket has been closed.
335
- </p>
336
- <p>
337
- All hooks will be called, except <a
338
- href="AbstractServer.html#M000058">before_fork</a>().
339
- </p>
340
- </div>
341
- <div class="sourcecode">
342
- <p class="source-link">[ <a href="javascript:toggleSource('M000054_source')" id="l_M000054_source">show source</a> ]</p>
343
- <div id="M000054_source" class="dyn-source">
344
- <pre>
345
- <span class="ruby-comment cmt"># File lib/passenger/abstract_server.rb, line 161</span>
346
- 161: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start_synchronously</span>(<span class="ruby-identifier">socket</span>)
347
- 162: <span class="ruby-ivar">@child_socket</span> = <span class="ruby-identifier">socket</span>
348
- 163: <span class="ruby-ivar">@child_channel</span> = <span class="ruby-constant">MessageChannel</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">socket</span>)
349
- 164: <span class="ruby-keyword kw">begin</span>
350
- 165: <span class="ruby-identifier">reset_signal_handlers</span>
351
- 166: <span class="ruby-identifier">initialize_server</span>
352
- 167: <span class="ruby-keyword kw">begin</span>
353
- 168: <span class="ruby-identifier">main_loop</span>
354
- 169: <span class="ruby-keyword kw">ensure</span>
355
- 170: <span class="ruby-identifier">finalize_server</span>
356
- 171: <span class="ruby-keyword kw">end</span>
357
- 172: <span class="ruby-keyword kw">ensure</span>
358
- 173: <span class="ruby-identifier">revert_signal_handlers</span>
359
- 174: <span class="ruby-keyword kw">end</span>
360
- 175: <span class="ruby-keyword kw">end</span>
361
- </pre>
362
- </div>
363
- </div>
364
- </div>
365
- <div class="method">
366
- <div class="title">
367
- <a name="M000056"></a><b>started?</b>()
368
- </div>
369
- <div class="description">
370
- <p>
371
- Return whether the <a href="AbstractServer.html#M000063">server</a> has
372
- been started.
373
- </p>
374
- </div>
375
- <div class="sourcecode">
376
- <p class="source-link">[ <a href="javascript:toggleSource('M000056_source')" id="l_M000056_source">show source</a> ]</p>
377
- <div id="M000056_source" class="dyn-source">
378
- <pre>
379
- <span class="ruby-comment cmt"># File lib/passenger/abstract_server.rb, line 211</span>
380
- 211: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">started?</span>
381
- 212: <span class="ruby-keyword kw">return</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@parent_channel</span>.<span class="ruby-identifier">nil?</span>
382
- 213: <span class="ruby-keyword kw">end</span>
383
- </pre>
384
- </div>
385
- </div>
386
- </div>
387
- <div class="method">
388
- <div class="title">
389
- <a name="M000055"></a><b>stop</b>()
390
- </div>
391
- <div class="description">
392
- <p>
393
- Stop the <a href="AbstractServer.html#M000063">server</a>. The <a
394
- href="AbstractServer.html#M000063">server</a> will quit as soon as
395
- possible. This method waits until the <a
396
- href="AbstractServer.html#M000063">server</a> has been stopped.
397
- </p>
398
- <p>
399
- When calling this method, the <a
400
- href="AbstractServer.html#M000063">server</a> must already be started. If
401
- not, a <a href="AbstractServer/ServerNotStarted.html">ServerNotStarted</a>
402
- will be raised.
403
- </p>
404
- </div>
405
- <div class="sourcecode">
406
- <p class="source-link">[ <a href="javascript:toggleSource('M000055_source')" id="l_M000055_source">show source</a> ]</p>
407
- <div id="M000055_source" class="dyn-source">
408
- <pre>
409
- <span class="ruby-comment cmt"># File lib/passenger/abstract_server.rb, line 182</span>
410
- 182: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stop</span>
411
- 183: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">started?</span>
412
- 184: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ServerNotStarted</span>, <span class="ruby-value str">&quot;Server is not started&quot;</span>
413
- 185: <span class="ruby-keyword kw">end</span>
414
- 186:
415
- 187: <span class="ruby-ivar">@parent_socket</span>.<span class="ruby-identifier">close</span>
416
- 188: <span class="ruby-ivar">@parent_channel</span> = <span class="ruby-keyword kw">nil</span>
417
- 189:
418
- 190: <span class="ruby-comment cmt"># Wait at most 3 seconds for server to exit. If it doesn't do that,</span>
419
- 191: <span class="ruby-comment cmt"># we kill it. If that doesn't work either, we kill it forcefully with</span>
420
- 192: <span class="ruby-comment cmt"># SIGKILL.</span>
421
- 193: <span class="ruby-keyword kw">begin</span>
422
- 194: <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-identifier">timeout</span>(<span class="ruby-value">3</span>) <span class="ruby-keyword kw">do</span>
423
- 195: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">waitpid</span>(<span class="ruby-ivar">@pid</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
424
- 196: <span class="ruby-keyword kw">end</span>
425
- 197: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>
426
- 198: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">kill</span>(<span class="ruby-constant">SERVER_TERMINATION_SIGNAL</span>, <span class="ruby-ivar">@pid</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
427
- 199: <span class="ruby-keyword kw">begin</span>
428
- 200: <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-identifier">timeout</span>(<span class="ruby-value">3</span>) <span class="ruby-keyword kw">do</span>
429
- 201: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">waitpid</span>(<span class="ruby-ivar">@pid</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
430
- 202: <span class="ruby-keyword kw">end</span>
431
- 203: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>
432
- 204: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">kill</span>(<span class="ruby-value str">'SIGKILL'</span>, <span class="ruby-ivar">@pid</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
433
- 205: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">waitpid</span>(<span class="ruby-ivar">@pid</span>, <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-constant">WNOHANG</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
434
- 206: <span class="ruby-keyword kw">end</span>
435
- 207: <span class="ruby-keyword kw">end</span>
436
- 208: <span class="ruby-keyword kw">end</span>
437
- </pre>
438
- </div>
439
- </div>
440
- </div>
441
- <div class="sectiontitle">Protected Instance methods</div>
442
- <div class="method">
443
- <div class="title">
444
- <a name="M000058"></a><b>before_fork</b>()
445
- </div>
446
- <div class="description">
447
- <p>
448
- A hook which is called when the <a
449
- href="AbstractServer.html#M000063">server</a> is being started, just before
450
- forking a <a href="AbstractServer.html#M000052">new</a> process. The
451
- default implementation does nothing, this method is supposed to be
452
- overrided by child classes.
453
- </p>
454
- </div>
455
- <div class="sourcecode">
456
- <p class="source-link">[ <a href="javascript:toggleSource('M000058_source')" id="l_M000058_source">show source</a> ]</p>
457
- <div id="M000058_source" class="dyn-source">
458
- <pre>
459
- <span class="ruby-comment cmt"># File lib/passenger/abstract_server.rb, line 223</span>
460
- 223: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">before_fork</span>
461
- 224: <span class="ruby-keyword kw">end</span>
462
- </pre>
463
- </div>
464
- </div>
465
- </div>
466
- <div class="method">
467
- <div class="title">
468
- <a name="M000064"></a><b>client</b>()
469
- </div>
470
- <div class="description">
471
- <p>
472
- Return the communication channel with the <a
473
- href="AbstractServer.html#M000064">client</a> (i.e. the parent process that
474
- started the <a href="AbstractServer.html#M000063">server</a>). This is a <a
475
- href="MessageChannel.html">MessageChannel</a> object.
476
- </p>
477
- </div>
478
- <div class="sourcecode">
479
- <p class="source-link">[ <a href="javascript:toggleSource('M000064_source')" id="l_M000064_source">show source</a> ]</p>
480
- <div id="M000064_source" class="dyn-source">
481
- <pre>
482
- <span class="ruby-comment cmt"># File lib/passenger/abstract_server.rb, line 268</span>
483
- 268: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">client</span>
484
- 269: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@child_channel</span>
485
- 270: <span class="ruby-keyword kw">end</span>
486
- </pre>
487
- </div>
488
- </div>
489
- </div>
490
- <div class="method">
491
- <div class="title">
492
- <a name="M000061"></a><b>define_message_handler</b>(message_name, handler)
493
- </div>
494
- <div class="description">
495
- <p>
496
- Define a handler for a message. <em>message_name</em> is the name of the
497
- message to handle, and <em>handler</em> is the name of a method to be
498
- called (this may either be a String or a Symbol).
499
- </p>
500
- <p>
501
- A message is just a list of strings, and so <em>handler</em> will be called
502
- with the message as its arguments, excluding the first element. See also
503
- the example in the class description.
504
- </p>
505
- </div>
506
- <div class="sourcecode">
507
- <p class="source-link">[ <a href="javascript:toggleSource('M000061_source')" id="l_M000061_source">show source</a> ]</p>
508
- <div id="M000061_source" class="dyn-source">
509
- <pre>
510
- <span class="ruby-comment cmt"># File lib/passenger/abstract_server.rb, line 243</span>
511
- 243: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">define_message_handler</span>(<span class="ruby-identifier">message_name</span>, <span class="ruby-identifier">handler</span>)
512
- 244: <span class="ruby-ivar">@message_handlers</span>[<span class="ruby-identifier">message_name</span>.<span class="ruby-identifier">to_s</span>] = <span class="ruby-identifier">handler</span>
513
- 245: <span class="ruby-keyword kw">end</span>
514
- </pre>
515
- </div>
516
- </div>
517
- </div>
518
- <div class="method">
519
- <div class="title">
520
- <a name="M000062"></a><b>define_signal_handler</b>(signal, handler)
521
- </div>
522
- <div class="description">
523
- <p>
524
- Define a handler for a signal.
525
- </p>
526
- </div>
527
- <div class="sourcecode">
528
- <p class="source-link">[ <a href="javascript:toggleSource('M000062_source')" id="l_M000062_source">show source</a> ]</p>
529
- <div id="M000062_source" class="dyn-source">
530
- <pre>
531
- <span class="ruby-comment cmt"># File lib/passenger/abstract_server.rb, line 248</span>
532
- 248: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">define_signal_handler</span>(<span class="ruby-identifier">signal</span>, <span class="ruby-identifier">handler</span>)
533
- 249: <span class="ruby-ivar">@signal_handlers</span>[<span class="ruby-identifier">signal</span>.<span class="ruby-identifier">to_s</span>] = <span class="ruby-identifier">handler</span>
534
- 250: <span class="ruby-keyword kw">end</span>
535
- </pre>
536
- </div>
537
- </div>
538
- </div>
539
- <div class="method">
540
- <div class="title">
541
- <a name="M000060"></a><b>finalize_server</b>()
542
- </div>
543
- <div class="description">
544
- <p>
545
- A hook which is called when the <a
546
- href="AbstractServer.html#M000063">server</a> is being stopped. This is
547
- called in the child process, after the main loop has been left. The default
548
- implementation does nothing, this method is supposed to be overrided by
549
- child classes.
550
- </p>
551
- </div>
552
- <div class="sourcecode">
553
- <p class="source-link">[ <a href="javascript:toggleSource('M000060_source')" id="l_M000060_source">show source</a> ]</p>
554
- <div id="M000060_source" class="dyn-source">
555
- <pre>
556
- <span class="ruby-comment cmt"># File lib/passenger/abstract_server.rb, line 235</span>
557
- 235: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">finalize_server</span>
558
- 236: <span class="ruby-keyword kw">end</span>
559
- </pre>
560
- </div>
561
- </div>
562
- </div>
563
- <div class="method">
564
- <div class="title">
565
- <a name="M000059"></a><b>initialize_server</b>()
566
- </div>
567
- <div class="description">
568
- <p>
569
- A hook which is called when the <a
570
- href="AbstractServer.html#M000063">server</a> is being started. This is
571
- called in the child process, before the main loop is entered. The default
572
- implementation does nothing, this method is supposed to be overrided by
573
- child classes.
574
- </p>
575
- </div>
576
- <div class="sourcecode">
577
- <p class="source-link">[ <a href="javascript:toggleSource('M000059_source')" id="l_M000059_source">show source</a> ]</p>
578
- <div id="M000059_source" class="dyn-source">
579
- <pre>
580
- <span class="ruby-comment cmt"># File lib/passenger/abstract_server.rb, line 229</span>
581
- 229: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize_server</span>
582
- 230: <span class="ruby-keyword kw">end</span>
583
- </pre>
584
- </div>
585
- </div>
586
- </div>
587
- <div class="method">
588
- <div class="title">
589
- <a name="M000065"></a><b>quit_main</b>()
590
- </div>
591
- <div class="description">
592
- <p>
593
- Tell the main loop to <a href="AbstractServer.html#M000055">stop</a> as
594
- soon as possible.
595
- </p>
596
- </div>
597
- <div class="sourcecode">
598
- <p class="source-link">[ <a href="javascript:toggleSource('M000065_source')" id="l_M000065_source">show source</a> ]</p>
599
- <div id="M000065_source" class="dyn-source">
600
- <pre>
601
- <span class="ruby-comment cmt"># File lib/passenger/abstract_server.rb, line 273</span>
602
- 273: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">quit_main</span>
603
- 274: <span class="ruby-ivar">@done</span> = <span class="ruby-keyword kw">true</span>
604
- 275: <span class="ruby-keyword kw">end</span>
605
- </pre>
606
- </div>
607
- </div>
608
- </div>
609
- <div class="method">
610
- <div class="title">
611
- <a name="M000063"></a><b>server</b>()
612
- </div>
613
- <div class="description">
614
- <p>
615
- Return the communication channel with the <a
616
- href="AbstractServer.html#M000063">server</a>. This is a <a
617
- href="MessageChannel.html">MessageChannel</a> object.
618
- </p>
619
- <p>
620
- Raises <a href="AbstractServer/ServerNotStarted.html">ServerNotStarted</a>
621
- if the <a href="AbstractServer.html#M000063">server</a> hasn&#8216;t been
622
- started yet.
623
- </p>
624
- <p>
625
- This method may only be called in the parent process, and not in the
626
- started <a href="AbstractServer.html#M000063">server</a> process.
627
- </p>
628
- </div>
629
- <div class="sourcecode">
630
- <p class="source-link">[ <a href="javascript:toggleSource('M000063_source')" id="l_M000063_source">show source</a> ]</p>
631
- <div id="M000063_source" class="dyn-source">
632
- <pre>
633
- <span class="ruby-comment cmt"># File lib/passenger/abstract_server.rb, line 259</span>
634
- 259: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">server</span>
635
- 260: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">started?</span>
636
- 261: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ServerNotStarted</span>, <span class="ruby-value str">&quot;Server hasn't been started yet. Please call start() first.&quot;</span>
637
- 262: <span class="ruby-keyword kw">end</span>
638
- 263: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@parent_channel</span>
639
- 264: <span class="ruby-keyword kw">end</span>
640
- </pre>
641
- </div>
642
- </div>
643
- </div>
644
- </div>
645
-
646
- </div>
647
-
648
- </body>
649
- </html>