JsonCommandAssembly implementation in app web

Aug 11, 2011 at 4:15 AM
Edited Aug 11, 2011 at 2:05 PM

Hi kerryjiang, i need your help please!, i set the web.config in the superwebsocketweb with the assembly JsonCommandAssembly CHAT example, added to the configuration

<socketServer>
        <servers>
            <server name="SuperWebSocket"
                    serviceName="SuperWebSocket"
                    ip="Any" port="2011" mode="Async"
                    commandAssembly="SuperWebSocket.Samples.JsonCommandAssembly">
            </server>
            <server name="SecureSuperWebSocket"
                    serviceName="SuperWebSocket"
                    ip="Any" port="2012" mode="Sync" security="tls"
                    commandAssembly="SuperWebSocket.Samples.JsonCommandAssembly">
                <!--Please install the certificate to your trusted certificates store, the password is 'supersocket'-->
                <certificate filePath="supersocket.pfx"
                             password="supersocket"
                             isEnabled="true"></certificate>
            </server>
        </servers>
        <services>
            <service name="SuperWebSocket"
                     type="SuperWebSocket.WebSocketServer, SuperWebSocket" />
        </services>
    </socketServer>

and when running the application gives me the following error 

You cannot set the NewMessageReceived handler if you have defined the commands of your sub protocol!

thanks in advance

Aug 11, 2011 at 5:13 AM
Yes, the reason is:
You cannot set the NewMessageReceived handler if you have defined the commands of your sub protocol!
Please don't set NewMessageReceived handler, all requests should be handled by your command assembly.

From: [email removed]
Sent: Thursday, August 11, 2011 11:15 AM
To: [email removed]
Subject: JsonCommandAssembly implementation in app web [SuperWebSocket:268622]

From: mlhoo

Hi kerryjiang, i need your help please!, i set the web.config in the superwebsocketweb with the assembly JsonCommandAssembly CHAT example, added to the configuration

<socketServer>
        <servers>
            <server name="SuperWebSocket"
                    serviceName="SuperWebSocket"
                    ip="Any" port="2011" mode="Async"
                    commandAssembly="SuperWebSocket.Samples.JsonCommandAssembly">
            </server>
            <server name="SecureSuperWebSocket"
                    serviceName="SuperWebSocket"
                    ip="Any" port="2012" mode="Sync" security="tls"
                    commandAssembly="SuperWebSocket.Samples.JsonCommandAssembly">
                <!--Please install the certificate to your trusted certificates store, the password is 'supersocket'-->
                <certificate filePath="supersocket.pfx"
                             password="supersocket"
                             isEnabled="true"></certificate>
            </server>
        </servers>
        <services>
            <service name="SuperWebSocket"
                     type="SuperWebSocket.WebSocketServer, SuperWebSocket" />
        </services>
    </socketServer>
 
and when running the application gives me the following error


You cannot set the NewMessageReceived handler if you have defined the commands of your sub protocol!
thanks in advance.

Aug 11, 2011 at 2:12 PM
Edited Aug 11, 2011 at 2:13 PM

perfect.. i worked :)

thanks kerryjiang, this way of programming the JsonCommand is more comfortable and flexible.