Slight refactoring
This commit is contained in:
@@ -56,7 +56,7 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MasterServices.cs" />
|
||||
<Compile Include="FrontendServices.cs" />
|
||||
<Compile Include="FrontendLoop.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Swarmops.Frontend.Socket
|
||||
OutboundComm.CreateNotification(null, NotificationResource.System_Startup_Frontend);
|
||||
|
||||
_socketServer = new WebSocketServer (SystemSettings.WebsocketPortFrontend);
|
||||
_socketServer.AddWebSocketService<MasterServices> ("/Master");
|
||||
_socketServer.AddWebSocketService<FrontendServices> ("/Front");
|
||||
// _socketServer.KeepClean = false; // as per the author's recommendation - this may be bad in the long run
|
||||
_socketServer.Start();
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@ using WebSocketSharp.Server;
|
||||
|
||||
namespace Swarmops.Frontend.Socket
|
||||
{
|
||||
internal class MasterServices: WebSocketBehavior
|
||||
internal class FrontendServices: WebSocketBehavior
|
||||
{
|
||||
public MasterServices()
|
||||
public FrontendServices()
|
||||
{
|
||||
base.IgnoreExtensions = true; // Necessary to suppress a Deflate exception that kills server otherwise
|
||||
}
|
||||
@@ -47,10 +47,10 @@ function _masterInitializeSocket(authenticationTicket) {
|
||||
|
||||
function getMasterSocketAddress() {
|
||||
if (location.host.indexOf ("localhost") >= 0) { // Assume dev environment, go for sandbox socket
|
||||
return 'ws://sandbox.swarmops.com/ws/Master';
|
||||
return 'ws://sandbox.swarmops.com/ws/Front';
|
||||
} else {
|
||||
var protocol = ('https:' == document.location.protocol ? 'wss://' : 'ws://');
|
||||
return protocol + location.host + "/ws/Master";
|
||||
return protocol + location.host + "/ws/Front";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user