Basic configuration


//Sample configuration
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
        <section name="socketServer" type="SuperSocket.SocketEngine.Configuration.SocketServiceConfig, SuperSocket.SocketEngine"/>
    </configSections>
    <appSettings>
        <add key="ServiceName" value="BroardcastService"/>
    </appSettings>
    <socketServer loggingMode="IndependantFile">
        <servers>
            <server name="BroardcastServer"
                    serviceName="BroardcastService"
                    ip="Any" port="911" mode="Async">
            </server>
        </servers>
        <services>
            <service name="BroardcastService"
                     type="SuperSocket.QuickStart.BroadcastService.BroadcastServer, SuperSocket.QuickStart.BroadcastService" />
        </services>
    </socketServer>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
    </startup>
</configuration>

  • Service name
<appSettings>
        <add key="ServiceName" value="BroardcastService"/>
</appSettings>

This configuration value will be used as the name of SuperSocket windows service. The a SuperSocket service is configured like this sample, after run the bat file InstallService.bat, a service named as "BroadcastService" will be added into windows service list.
  • The root configuration of SuperSocket
<socketServer loggingMode="IndependantFile">
    ....
</socketServer>

loggingMode:
ShareFile, IndependantFile, Console. ShareFile is default option. Console only works in console application
maxWorkingThreads: (supported in v1.4 or later)
Maximum working thread count of application thread pool
minWorkingThreads (supported in v1.4 or later)
Minimum working thread count of application thread pool
maxCompletionPortThreads (supported in v1.4 or later)
Maximum completion port thread count of application thread pool
minCompletionPortThreads (supported in v1.4 or later)
Minimum completion port thread count of application thread pool
  • Server configuration
    <servers>
            <server name="BroardcastServer"
                    serviceName="BroardcastService"
                    ip="Any"
                    port="911"
                    mode="Async">
            </server>
    </servers>

name: The server instance name
serviceName: Specific which kind of service the server instance run as. It's the name of one service node element.
ip: The ip address the socket server listen on. Any, listen on all IPv4 address. IPv6Any, listen on all IPv6 address.
port: The port the socket server will listen on.
mode: Sync/Async/Udp
disabled: true or false. Whether the server is disabled, disabled server will not be started.
readTimeOut: Read timeout of socket server, default value is 0.
sendTimeOut: Send timeout of socket server, default value is 0.
maxConnectionNumber: Maximum allowed connection number. Default value is 100.
receiveBufferSize: The buffer size used for receiving, default value is 2048.
sendBufferSize: The buffer size used for sending, default value is 2048.
logCommand: true or false, whether log commands.
clearIdleSession: true or false, whether clear idle sessions. Default value is false.
clearIdleSessionInterval: the clearing timeout idle session interval. Default value is 120, in seconds.
idleSessionTimeOut: The session timeout period. Default value is 300, in seconds.
security: Empty, Tls, Ssl3. The security option of the socket server. Default value is empty.
maxCommandLength: The maximum allowed command length. Default value is 1024.
disableSessionSnapshot: Indicate whether disable session snapshot. Default value is false. (1.4 SP1)
sessionSnapshotInterval: The interval of taking session snapshot. Default value is 5, in seconds.
keepAliveTime: The interval of keeping alive. Default value is 600, in seconds.
keepAliveInterval: The interval of retry after keep alive fail. Default value is 60, in seconds.
//Multiple server instances
    <servers>
            <server name="BroardcastServerA"
                    serviceName="BroardcastService"
                    ip="Any"
                    port="911"
                    mode="Async">
            </server>
            <server name="BroardcastServerB"
                    serviceName="BroardcastService"
                    ip="Any"
                    port="912"
                    mode="Async">
            </server>
    </servers>
  • Service configuration
Before v1.4
    <services>
            <service serviceName="BroardcastService"
                     type="SuperSocket.QuickStart.BroadcastService.BroadcastServer, SuperSocket.QuickStart.BroadcastService" />
    </services>

v1.4 or later
    <services>
            <service name="BroardcastService"
                     type="SuperSocket.QuickStart.BroadcastService.BroadcastServer, SuperSocket.QuickStart.BroadcastService" />
    </services>

serviceName: The name of the service definition. Before v1.4.
name: The name of the service definition. v1.4 or later
type: The full type name of the implemented AppServer's type.

Last edited Sep 21, 2011 at 5:59 AM by kerryjiang, version 32

Comments

No comments yet.