Upgrade from SuperSocket 1.4
- ICommandInfo => IRequestInfo
- ICommandInfo.Data => IRequestInfo.Body
- BinaryCommandInfo => BinaryRequestInfo
- StringCommandInfo => StringRequestInfo
- ICustomProtocol => IReceiveFilter
- AppSession.SendResponse() => AppSession.Send()
- AppSession.StartSession() => AppSession.OnSessionStarted()
- AppSession.HandleExceptionalError(Exception e) => AppSession.HandleException(Exception e)
- AppServer.OnAppSessionClosed(TAppSession session, CloseReason reason) => AppServer.OnSessionClosed(TAppSession session, CloseReason reason)
- Section name was changed: "socketServer" => "superSocket"
Configuration of v1.4:
New configuration:
<configuration>
<configSections>
<section name="superSocket" type="SuperSocket.SocketEngine.Configuration.SocketServiceConfig, SuperSocket.SocketEngine"/>
</configSections>
<appSettings>
<add key="ServiceName" value="GPSSocketServer"/>
<superSocket>
....
</superSocket>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
</configuration>
- The attribute "mode"'s available values are changed from "Sync/Async/Udp" to "Tcp/Udp":
v1.5:
- The node "services" was changed to be "serverTypes":
v1.4:
<socketServer>
...
<services>
<service name="GPSSocketService"
type="SuperSocket.QuickStart.GPSSocketServer.GPSServer, SuperSocket.QuickStart.GPSSocketServer" />
</services>
</socketServer>
<superSocket>
...
<serverTypes>
<add name="GPSSocketService"
</serverTypes>
</superSocket>
- The attribute "serviceName" of server node was changed to be "serverTypeName":
v1.4:
New:
serverTypeName="GPSSocketService"
ip="Any" port="2012">
</server>
- Logger.LogInfo() => Logger.Info();
- Logger.LogDebug() => Logger.Debug();
- Logger.LogError() => Logger.Error();
var serverConfig = ConfigurationManager.GetSection("socketServer") as SocketServiceConfig;
if (!SocketServerManager.Initialize(serverConfig))
{
race.WriteLine("Failed to initialize SuperSocket!", "Error");
return false;
}
if (!SocketServerManager.Start())
{
Trace.WriteLine("Failed to start SuperSocket!", "Error");
}
The new bootstrap: