Inheritance: Simpl.OODSS.Distributed.Impl.AbstractServer, ServerProcessor
        public static void StartServer()
        {
            SimplTypesScope chatTranslation = ChatTranslations.Get();
            Scope<object> applicationScope = new Scope<object>();

            IPAddress[] locals = NetTools.GetAllIPAddressesForLocalhost();

            WebSocketOODSSServer chatServer = new WebSocketOODSSServer(chatTranslation, applicationScope, _idleTimeout,
                                                                       _MTU);

            chatServer.Start();
        }
        /// <summary>
        /// Initialize a websocket oodss server object
        /// </summary>
        /// <param name="serverTranslationScope">translationscope for the oodss messages</param>
        /// <param name="applicationObjectScope">server object scope</param>
        /// <param name="idleConnectionTimeout"></param>
        /// <param name="maxMessageSize"></param>
        public WebSocketOODSSServer(SimplTypesScope serverTranslationScope, Scope<object> applicationObjectScope,
			int idleConnectionTimeout=-1, int maxMessageSize=-1, int port=0)
            : base(port, Dns.GetHostAddresses(Dns.GetHostName()), serverTranslationScope, applicationObjectScope, 
            idleConnectionTimeout, maxMessageSize)
        {
            MaxMessageSize = maxMessageSize + NetworkConstants.MaxHttpHeaderLength;
            TranslationScope = serverTranslationScope;

            ApplicationObjectScope = applicationObjectScope;

            ApplicationObjectScope.Add(SessionObjects.SessionsMap, ClientSessionManagerMap);
            ApplicationObjectScope.Add(SessionObjects.WebSocketOODSSServer, this);

            _serverInstance = this;

            SetUpWebSocketServer(port);
        }
        /// <summary>
        /// Initialize a websocket oodss server object
        /// </summary>
        /// <param name="serverTranslationScope">translationscope for the oodss messages</param>
        /// <param name="applicationObjectScope">server object scope</param>
        /// <param name="idleConnectionTimeout"></param>
        /// <param name="maxMessageSize"></param>
        public WebSocketOODSSServer(SimplTypesScope serverTranslationScope, Scope <object> applicationObjectScope,
                                    int idleConnectionTimeout = -1, int maxMessageSize = -1, int port = 0)
            : base(port, Dns.GetHostAddresses(Dns.GetHostName()), serverTranslationScope, applicationObjectScope,
                   idleConnectionTimeout, maxMessageSize)
        {
            MaxMessageSize   = maxMessageSize + NetworkConstants.MaxHttpHeaderLength;
            TranslationScope = serverTranslationScope;

            ApplicationObjectScope = applicationObjectScope;

            ApplicationObjectScope.Add(SessionObjects.SessionsMap, ClientSessionManagerMap);
            ApplicationObjectScope.Add(SessionObjects.WebSocketOODSSServer, this);

            _serverInstance = this;

            SetUpWebSocketServer(port);
        }
Exemple #4
0
 public TestServer(int port)
 {
     _applicationObjectScope = new Scope<object>();
     _serviceTypesScope = TestServiceTypesScope.Get();
     _webSocketOODSSServer = new WebSocketOODSSServer(_serviceTypesScope, _applicationObjectScope, -1, -1, port);
 }