WebSocket MessageReceived or DataReceived is not working in my sample

Oct 4, 2012 at 1:09 PM


     I am using WebSocket as following, and able to send message to server but from server I am not able to receive message. I am expecting either of the event to work MessageReceived or DataReceived 


WebSocket websocket = new WebSocket("ws://");            
websocket.Opened += new EventHandler(websocket_Opened);

websocket.Closed += new EventHandler(websocket_Closed);            websocket.MessageReceived += new EventHandler<MessageReceivedEventArgs>(websocket_MessageReceived);           

websocket.DataReceived += new EventHandler<DataReceivedEventArgs>(websocket_DataReceived);


Oct 4, 2012 at 2:40 PM

Your websocket can be opened?

I mean the method "websocket_Opened" has ever been fired?

Oct 5, 2012 at 5:00 AM

Yes WebSocket is getting Opened and the "websocket_Opened" also fired. But I am not able to get message from server, i.e, neither of the events "websocket_MessageReceived and "websocket_DataReceived" are getting fired