Personal session, what is better?

Oct 18, 2011 at 9:19 AM
Edited Oct 18, 2011 at 9:19 AM

What is better, the oficial:


public class WebSocketServer2 : WebSocketServer<CustomSession> {
         //Because the sample process requests by sub protocol, so passing sub protocol instance to parent class in the line below is required
         public WebSocketServer2(): base(new List<ISubProtocol<CustomSession>> { new BasicSubProtocol<CustomSession>(new List<Assembly>{ typeof(WebSocketServer2).Assembly }) }) { }
}

or...

public class WebSocketServer2 : WebSocketServer<CustomSession> {
        public WebSocketServer2(ISubProtocol<CustomSession> subProtocol) : base(subProtocol) { }
        public WebSocketServer2() : base() { }
}

?

Thanks for answer.

Coordinator
Oct 18, 2011 at 9:22 AM

Both looks ok, what you should do is ensure your command assembly can be loaded correctly!