… | |
… | |
168 | you try to connect with each other!> |
168 | you try to connect with each other!> |
169 | |
169 | |
170 | Thats is all for now, you will find some more advanced fiddling with the |
170 | Thats is all for now, you will find some more advanced fiddling with the |
171 | C<aemp> utility later. |
171 | C<aemp> utility later. |
172 | |
172 | |
|
|
173 | =head2 Shooting the Trouble |
|
|
174 | |
|
|
175 | Sometimes things go wrong, and AnyEvent::MP, being a professional module, |
|
|
176 | does not gratitiously spill out messages to your screen. |
|
|
177 | |
|
|
178 | To help troubleshooting any issues, there are two environment variables |
|
|
179 | that you can set. The first, C<PERL_ANYEVENT_MP_WARNLEVEL> sets the |
|
|
180 | logging level. The default is C<5>, which means nothing much is |
|
|
181 | printed. Youc an increase it to C<8> or C<9> to get more verbose |
|
|
182 | output. This is example output when starting a node: |
|
|
183 | |
|
|
184 | 2009-08-31 19:51:50 <8> node anon/5RloFvvYL8jfSScXNL8EpX starting up. |
|
|
185 | 2009-08-31 19:51:50 <7> starting global service. |
|
|
186 | 2009-08-31 19:51:50 <9> 10.0.0.17:4040 connected as ruth |
|
|
187 | 2009-08-31 19:51:50 <7> ruth is up () |
|
|
188 | 2009-08-31 19:51:50 <9> ruth told us it knows about {"doom":["10.0.0.5:45143"],"rain":["10.0.0.19:4040"],"anon/4SYrtJ3ft5l1C16w2hto3t":["10.0.0.1:45920","[2002:58c6:438b:20:21d:60ff:fee8:6e36]:35788","[fd00::a00:1]:37104"],"frank":["10.0.0.18:4040"]}. |
|
|
189 | 2009-08-31 19:51:50 <9> connecting to doom with [10.0.0.5:45143] |
|
|
190 | 2009-08-31 19:51:50 <9> connecting to anon/4SYrtJ3ft5l1C16w2hto3t with [10.0.0.1:45920 [2002:58c6:438b:20:21d:60ff:fee8:6e36]:35788 [fd00::a00:1]:37104] |
|
|
191 | 2009-08-31 19:51:50 <9> ruth told us its addresses (10.0.0.17:4040). |
|
|
192 | |
|
|
193 | A lot of info, but at least you can see that it does something. |
|
|
194 | |
|
|
195 | The other environment variable that can be useful is |
|
|
196 | C<PERL_ANYEVENT_MP_TRACE>, which, when set to a true value, will cause |
|
|
197 | most messages that are sent or received to be printed. In the above |
|
|
198 | example you would see something like: |
|
|
199 | |
|
|
200 | SND ruth <- ["addr",["10.0.0.1:49358","[2002:58c6:438b:20:21d:60ff:fee8:6e36]:58884","[fd00::a00:1]:45006"]] |
|
|
201 | RCV ruth -> ["","AnyEvent::MP::_spawn","20QA7cWubCLTWUhFgBKOx2.x","AnyEvent::MP::Global::connect",0,"ruth"] |
|
|
202 | RCV ruth -> ["","mon1","20QA7cWubCLTWUhFgBKOx2.x"] |
|
|
203 | RCV ruth -> ["20QA7cWubCLTWUhFgBKOx2.x","addr",["10.0.0.17:4040"]] |
|
|
204 | RCV ruth -> ["20QA7cWubCLTWUhFgBKOx2.x","nodes",{"doom":["10.0.0.5:45143"],"rain":["10.0.0.19:4040"],"anon/4SYrtJ3ft5l1C16w2hto3t":["10.0.0.1:45920","[2002:58c6:438b:20:21d:60ff:fee8:6e36]:35788","[fd00::a00:1]:37104"],"frank":["10.0.0.18:4040"]}] |
173 | |
205 | |
174 | =head1 PART 1: Passing Messages Between Processes |
206 | =head1 PART 1: Passing Messages Between Processes |
175 | |
207 | |
176 | =head2 The Receiver |
208 | =head2 The Receiver |
177 | |
209 | |