Thanks Kyriakos & Murphy! All of that worked except that the .body
attribute returned an empty string. I printed e.type and it was 0. I am
using a simple JAVA application t send message as follows:-

            Socket newsock = new Socket("localhost", 2603);
            System.out.println("Connected to localhost in port 2603");
            DataOutputStream dos = new
DataOutputStream(newsock.getOutputStream());

            dos.write("Neha".getBytes());

            dos.close();
            newsock.close();

Can you please tell me what might possibly wrong in my approach.

Regards,
Neha

On Wed, Aug 8, 2012 at 2:15 AM, Murphy McCauley
<[email protected]>wrote:

> On Aug 7, 2012, at 4:26 AM, Neha Jatav wrote:
>
>
>    1. I don't understand what is causing the error. Can you please
>    suggest what I am doing wrong?
>    2. I want to obtain the message in the form of a string. What is the
>    function to convert the incoming message into a string? (something
>    analogous to e.jsonstring in the JSON messenger handler)
>    3. I would like to add this messenger to my existing NOX application.
>    Do I just add the "def configure" alongside "def install" & "def
>    getInterface"? Do I need to append anything to the "def __init__"?
>
> Here's the link again to one of the threads I posted earlier:
> https://groups.google.com/d/msg/nox_dev/K3rB8a_dKaI/XKOU4Mo1dYQJ
>
> It has an example of using the messenger.
>
> Addressing your points specifically:
> 1) Kyriakos got this one
> 2) This is shown in step 2 of the above link.  It's the event's .body
> attribute.
> 3) It looks like you're currently modifying messenger.py.  Don't.  The
> proper procedure is shown in steps 1 and 3 of the above link.  Create your
> own component.  import Msg_event and register a handler in your install
> function.  Add pymessenger as a dependency in the meta.json.
>
> -- Murphy
>

Reply via email to