Cannot receive message until connection is closed

Mar 26, 2013 at 5:11 AM
Dear all

I try to test with a Win form application as server and a web client using SuperWebSocket. But I faced the problem that When I call session.Send("Welcome to SuperSocket Telnet Server"); The client didn't receive the message until I Close the server: appServer.Stop();

Some of my codes:

private void Form1_Load(object sender, EventArgs e)
    {
appServer = new WebSocketServer();
if (!appServer.Setup(2012))//Setup with listening port
        {
            MessageBox.Show("Error");
            return;
        }
appServer.NewSessionConnected += new SessionHandler<WebSocketSession>(appServer_NewSessionConnected);

if (!appServer.Start())
        {
            return;
        }
}

static void appServer_NewSessionConnected(WebSocketSession session)
    {
        session.Send("Welcome to SuperSocket Telnet Server");
    }

On client:

// when data is comming from the server, this metod is called
            ws.onmessage = function (evt) {
                appendMessage("# " + evt.data + "<br />");
            };
Please help. Thanks for your support.
Mar 26, 2013 at 10:40 AM
Could you tell me your environment? The OS, SuperWebSocket's version and so on.
Mar 26, 2013 at 11:13 AM
Sorry, the problem may come from the case I use WebSocketServer in WinForm application. I will investigate more. Thanks anyway.