How to pass SuperWebSocket configuration parameters to appServer.Setup method?

Sep 22, 2014 at 4:39 PM
Edited Sep 22, 2014 at 4:54 PM
I want to define some SuperWebSocket parameters in the app.config file. I want to use only the standard parameters defined in "Server Configuration" section of "SuperSocket Basic Configuration" page (

My app.config file is below:
<?xml version="1.0" encoding="utf-8" ?>
      <server name="SuperWebSocket"
              receiveBufferSize = "1048576"
              maxRequestLength = "1048576">
      <add name="SuperWebSocket"
           type="SuperWebSocket.WebSocketServer, SuperWebSocket" />
  1. What should be the code to pass the defined parameters to the [WebSocketServer].Setup method?
  2. Is it possible that server will use all defined parameters without extracting them one-by-one in code? I found the example of such operation for the older version of SuperSocket, but it does not work for SuperSocket 1.6+ (SocketServerManager does not exist). What should be the updated code?
        var serverConfig = ConfigurationManager.GetSection("superSocket") as SocketServiceConfig;
        if (!SocketServerManager.Initialize(serverConfig))
            Assert.Fail("SocketServerManager was not able to initialize");
Thank you!
Sep 22, 2014 at 5:59 PM
There is a document talking about that:

BTW, we don't have SocketServerManager now, follow the samples to use bootstrap.
Sep 23, 2014 at 9:27 AM
Thank you for your answer.
In your referenced page I found the following code to extract the specific value from IServerConfig config :
public class YourAppServer : AppServer
  private string m_PolicyFile;
  protected override bool Setup(IRootConfig rootConfig, IServerConfig config)
    m_PolicyFile = config.Options.GetValue("policyFile");
    if (string.IsNullOrEmpty(m_PolicyFile))
          Logger.Error("Configuration option policyFile is required!");
        return false;
    return true;
But how can I create the objects to pass to the method arguments (IRootConfig rootConfig, IServerConfig config) ?
Oct 20, 2014 at 5:48 AM
Hi All,

Can somebody post the example regarding how to migrate from SocketServerManager to BootStrap. In the sample application there is no example about how to add the multiple Web Socket Servers and adding different Listener classes.
Oct 23, 2014 at 7:59 AM
The docs of SuperSocket should be helpful