How to Recieve Message

Apr 24, 2014 at 7:38 AM
Edited Apr 24, 2014 at 7:39 AM
Hi I am trying to connect to node js server
able to successfully connect to it.
websocket.Open();
I re-directs me to
static void websocket_Opened(object sender, EventArgs e)
    {

    }
But I only want to receive the message from node socket server
how I can proceed ahead any idea...


Using C# 4.0 .Net framework Console App

Thanks
Coordinator
Apr 24, 2014 at 9:43 AM
You can register the MessageReceived event of the websocket object:
websocket.MessageReceived += new EventHandler(websocket_MessageReceived);
Apr 25, 2014 at 9:10 AM
Edited Apr 25, 2014 at 9:12 AM
Hi Kerry
thanks it is working now
I am able to receive message
void ws_MessageReceived(object sender, MessageReceivedEventArgs e)
    {
        string message = e.Message.ToString();
    }
but one thing If I want to check again whether Data is there or not on socket I dont won't to call the WebSocket.Open again
Is there a way it Keep on Checking the socket with Interval for updated data.

or

whenever there is more data in socket it should automatically called websocket.MessafeReceived

Thanks