Problem in InterprocessConnection


#1

Jules or someone awesome, please help me if you are convenience, or not. :P

I wanna build  a Socket plugin based on JuceBrowserPluginDemo.

here is my code:

class JuceDemoBrowserPlugin  : public BrowserPluginComponent,
                               public Button::Listener,
                               public InterprocessConnection
{
public:
    JuceDemoBrowserPlugin()
        : textBox (String::empty),
          button ("Send a message to the webpage")
    {
        addAndMakeVisible (textBox);
        textBox.setMultiLine (true);
        textBox.setBounds (8, 8, 300, 300);
        addAndMakeVisible (button);
        button.setBounds (320, 8, 180, 22);
        button.addListener (this);
        button.setEnabled (false);
        ourJavascriptObject = new DemoBrowserObject (this);
        
        textBox.setText (SystemStats::getJUCEVersion() + "\n\n"
                          + "Browser: " + getBrowserVersion() + "\n");
        if(connectToSocket("61.160.108.238",1078,6000)) 
            textBox.setText (textBox.getText() + "Connection success.\n");
        else
            textBox.setText (textBox.getText() + "Connection fail.\n");
    }
    ...

  void connectionMade()
    {
        textBox.setText (textBox.getText() + "connectionMade...\n");
    }
    void connectionLost()
    { 
        textBox.setText (textBox.getText() + "connectionLost...\n");
    }
    void messageReceived (const MemoryBlock& message) 
    {
        textBox.setText (textBox.getText() + "messageReceived\n");
    }

Result from my IE

JUCE v3.0.5
Browser: Internet Explorer 
Connection success.
connectionMade...

The question is why i can't get message from messageReceived() which is sent by server ? I can see it(fe:aa:ff:04:00:c2:96:24:cd:00:00:00:00:46:bb:0d) from Wireshark.

To be short, messageReceived() doesn't work, why?


#2

What do you have running at the server end? You understand that there must be a juce app running an InterprocessConnection at both ends for it to work, right?


#3

That is why I screw it up .Server is not my part, and it is code by C#.  In my case,  Should I use SocketHelpers to communicate, right? Thanks for your help, jules !


#4

I did it. StreamingSocket works. But Unlike InterprocessConnection, I must do the Thread program. Insatiable,sorry...