Ejemplo n.º 1
0
 public Message(RemotingPeer peer, RemotingManager remotingManager, Serializer serializer)
 {
     Serializer = serializer;
     Peer = peer;
     RemotingManager = remotingManager;
     Header = new DataHeader(Serializer);
     Flags = MessageFlags.None;
 }
Ejemplo n.º 2
0
 public Message(RemotingPeer peer, RemotingManager remotingManager, int localId, int remoteId, MessageType type, MessageFlags flags = MessageFlags.None)
     : this(peer, remotingManager)
 {
     Flags = flags;
     Header.CallType = type;
     Header.RemoteId = remoteId;
     Header.LocalId = localId;
     Header.Write();
 }
Ejemplo n.º 3
0
        public ReferenceManager(RemotingManager remotingManager)
        {
            referencesChanged = new HashSet<Reference>();

            localIdToReference = new Dictionary<int, Reference>();
            dataObjectToReference = new Dictionary<IObservableDataObject, Reference>();
            subscriptionToReference = new Dictionary<Subscription, Reference>();

            this.remotingManager = remotingManager;
        }
Ejemplo n.º 4
0
        public EditorServer(RemotingManager remotingManager, HostEndPoint endPoint)
            : base(remotingManager, endPoint)
        {
            UserManager = new UserManager();
            //serviceManager.AddImplementation<IUserManager>(UserManager);
            //var serviceManager = remotingManager.ServiceManager;
            //serviceManager.

            ProjectManager = new ProjectManager();
            //serviceManager.AddImplementation<IProjectManager>(ProjectManager);
        }
Ejemplo n.º 5
0
        public Server(RemotingManager remotingManager, HostEndPoint endPoint)
            : base(remotingManager)
        {
            // TODO: remove this from here
            //Flood.Network.NetworkInitialize();

            var server = new HostServer();
            host = server;

            var details = new HostConnectionDetails()
            {
                Address = endPoint.Address,
                Port = endPoint.Port,
                ChannelCount = ChannelCount
            };

            server.SessionPacket += OnPacket;
            server.CreateSocket(details);
        }
Ejemplo n.º 6
0
        public Application()
        {
            PlatformManager = new PlatformManager(CreateWxPlatformManager());

            Engine = new Engine(PlatformManager);
            Engine.Init();

            // Search for the location of the main assets folder.
            string assetsPath;
            if (!SearchForAssetsDirectory(out assetsPath))
                throw new Exception("Editor assets were not found");

            Archive = new ArchiveVirtual();
            Archive.MountDirectories(assetsPath, Allocator.GetHeap());

            ResourceManager = Engine.ResourceManager;
            ResourceManager.Archive = Archive;

            NativeWindowManager = Engine.WindowManager;

            RenderDevice = Engine.RenderDevice;

            ModuleManager = new ModuleManager();

            RemotingManager = new RemotingManager(ModuleManager);

            ModuleManager.Init(RemotingManager.ServiceManager);

            //Initiate global services
            WindowManager = new Windows.WindowManager(this);

            RemotingManager.ServiceManager.GetCreateImplementation<IWindowManager>(WindowManager);

            // FIXME: Introduce a better system to get at global objects (dependency injection?)
            RemotingManager.ServiceManager.Application = this;
        }
Ejemplo n.º 7
0
        public void TestServiceAsyncCall()
        {
            const ushort ServerPort = 13337;

            var moduleManager = new ModuleManager();
            var remotingManager = new RemotingManager(moduleManager);
            moduleManager.Init(remotingManager.ServiceManager);

            var endPoint = new HostEndPoint("localhost", ServerPort);

            // Start the server and setup our service.
            var server = new Server(remotingManager, endPoint);
            var serverThread = new Thread(Process);
            serverThread.Start(server);

            // Start the client and connect to the service.
            var client = new Client(remotingManager);
            var clientThread = new Thread(Process);
            clientThread.Start(client);

            var connectTask = client.Connect(endPoint);
            connectTask.Wait();
            Assert.IsTrue(connectTask.Result);

            var service = new ServiceTest();
            var serviceImpl = server.RemotingManager.ServiceManager.GetCreateImplementation<IServiceTest>(service);

            var serviceProxy = client.RemotingManager.ServiceManager.GetService<IServiceTest>(new SessionRemotingPeer(client.Session), serviceImpl.LocalId);
            var pingTask = serviceProxy.Ping();

            Assert.IsTrue(pingTask.Wait(1000));
            Assert.AreEqual("Pong", pingTask.Result);

            serverThread.Abort();
            clientThread.Abort();
         }
Ejemplo n.º 8
0
 public Client(RemotingManager remotingManager)
     : base(remotingManager)
 {}
Ejemplo n.º 9
0
 public Host(RemotingManager remotingManager)
 {
     RemotingManager = remotingManager;
 }
Ejemplo n.º 10
0
        public ContextManager(RemotingManager remotingManager, IContextLoader loader)
        {
            localIdToContext = new Dictionary<int, ContextInfo>();
            contextIdToContext = new Dictionary<IContextId, ContextInfo>();
            localIdCounter = 1;

            this.remotingManager = remotingManager;
            Loader = loader;
        }
Ejemplo n.º 11
0
 private Message(RemotingPeer peer, RemotingManager remotingManager)
     : this(peer, remotingManager, peer.CreateSerializer())
 {
 }
Ejemplo n.º 12
0
            internal DelegateCall(int id, RemotingPeer peer, RemotingManager remotingManager, int localId, int remoteId)
            {
                Id = id;
                Data = new Message(peer, remotingManager, localId, remoteId, MessageType.DelegateCall);

                Data.Serializer.WriteI32(id);
            }
Ejemplo n.º 13
0
            internal Call(int id, int methodId, RemotingPeer peer, RemotingManager remotingManager, int localId, int remoteId)
            {
                Id = id;
                MethodId = methodId;
                Data = new Message(peer, remotingManager, localId, remoteId, MessageType.Call);

                Data.Serializer.WriteI32(id);
                Data.Serializer.WriteI32(methodId);

                if (remoteId == 0)
                {
                    GlobalServiceId = remotingManager.ServiceManager.GetGlobalServiceId(localId);
                    GlobalServiceId.Write(Data);
                }
                else
                {
                    GlobalServiceId = default(GlobalServiceId);
                }
            }