示例#1
0
 public override void Start()
 {
     try {
         ConfigMitto();
         _Server = new Mitto.Server();
         _Server.Start(null, (c) => { });
     } catch (Exception ex) {
         Log.Error("Failed to set up the websocket server, clients will not be able to connect");
         Log.Error(ex);
     }
 }
示例#2
0
        public void StartSecureTest()
        {
            //Arrange
            var objConnectionProvider = Substitute.For <IConnection.IConnectionProvider>();
            var objAction             = Substitute.For <Action <ClientConnection> >();
            var objConnection         = Substitute.For <IServer>();
            var objParams             = Substitute.For <IServerParams>();

            objConnectionProvider.CreateServer().Returns(objConnection);

            Config.Initialize(new Config.ConfigParams()
            {
                ConnectionProvider = objConnectionProvider
            });

            //Act
            var obj = new Mitto.Server();

            obj.Start(objParams, objAction);

            //Assert
            objConnection.Received(1).Start(Arg.Is(objParams), Arg.Any <Action <IClientConnection> >());
        }