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?
