public InstanceServerContext(ISerializer serializer, IServerTransport transport) : base(serializer)
        {
            Transport = transport;

            OperationSystem = new OperationSystem(OperationMap, new SerializationService(Serializer), Transport, new OperationHandlerFactory(Container).CreateHandler);
            OperationSystem.Dispatcher.InitializeContext(ContextType.InstanceServer);
        }
예제 #2
0
 public AServiceServer(IServerTransport transport, IProtocol protocol, IAnnouncer announcer, IEncodableEndpoint endpoint)
 {
     this.transport = transport;
     this.protocol  = protocol;
     this.announcer = announcer;
     this.endpoint  = endpoint;
 }
예제 #3
0
 /// <summary>
 /// Initializes the RPC server using specified transport.
 /// </summary>
 /// <param name="transport">Transport instance.</param>
 public RpcServer(IServerTransport transport)
 {
     this.transport     = transport;
     this.cachedFactory = new Lazy <IProtocolObjectFactory>(
         this.CreateProtocolObjectFactory,
         LazyThreadSafetyMode.ExecutionAndPublication);
     this.EventSource = new GlobalEventSource(this);
 }
예제 #4
0
        protected ClientContextBase(ServerContextBase application, IServerTransport transport)
        {
            Application = application;
            Transport   = transport;

            Scope           = Application.Container.BeginLifetimeScope(this);
            OperationSystem = new OperationSystem(Application.OperationMap, new SerializationService(Application.Serializer), Transport, HandlerFactory);
        }
        public InstanceServerContext(ISerializer serializer, IServerTransport transport)
            : base(serializer)
        {
            Transport = transport;

            OperationSystem = new OperationSystem(OperationMap, new SerializationService(Serializer), Transport, new OperationHandlerFactory(Container).CreateHandler);
            OperationSystem.Dispatcher.InitializeContext(ContextType.InstanceServer);
        }
예제 #6
0
        protected ClientContextBase(ServerContextBase application, IServerTransport transport)
        {
            Application = application;
            Transport = transport;

            Scope = Application.Container.BeginLifetimeScope(this);
            OperationSystem = new OperationSystem(Application.OperationMap, new SerializationService(Application.Serializer), Transport, HandlerFactory);
        }
 public OperationState RegisterReceiveCommand <T>(IServerTransport serverTransport, T execute) where T : IServerCommand
 {
     if (serverTransport == null)
     {
         throw new ArgumentNullException(nameof(serverTransport));
     }
     if (execute == null)
     {
         throw new ArgumentNullException(nameof(execute));
     }
     return(RegisterReceiveCommand(serverTransport, typeof(T).Name, execute));
 }
        public OperationState RegisterReceiveCommand <T>(IServerTransport serverTransport, string commandName, T execute) where T : IServerCommand
        {
            if (serverTransport == null)
            {
                throw new ArgumentNullException(nameof(serverTransport));
            }
            if (string.IsNullOrEmpty(commandName))
            {
                throw new ArgumentNullException(nameof(commandName));
            }
            if (execute == null)
            {
                throw new ArgumentNullException(nameof(execute));
            }

            return(serverTransport.RegisterCommand(commandName, execute));
        }
예제 #9
0
        private Well(DataWellSettings settings, TransportTypes transportType)
        {
            _settings = DataEnvironment.DataWellSettings = settings;
            _storage  = DataEnvironment.MemStorage = new MemStorage();
            try
            {
                switch (transportType)
                {
                case TransportTypes.WebSocket:
                    _serverTransport = new WSServerTransport(settings);
                    break;

                case TransportTypes.Http:
                    throw new NotImplementedException();
                    break;

                default: break;
                }
            }
            catch (Exception e)
            {
                throw new Exception($"Well GetWell Error: {e.Message}");
            }
        }
예제 #10
0
 public AServiceServer(IServerTransport transport, IProtocol protocol)
 {
     this.transport = transport;
     this.protocol  = protocol;
 }
예제 #11
0
 public PlayerClientContext(ServerContextBase application, IServerTransport transport)
     : base(application, transport)
 {
 }
 public InstanceClientContext(ServerContextBase application, IServerTransport transport)
     : base(application, transport)
 {
 }
예제 #13
0
 public PlayerClientContext(ServerContextBase application, IServerTransport transport) : base(application, transport)
 {
 }
예제 #14
0
 public InstanceClientContext(ServerContextBase application, IServerTransport transport) : base(application, transport)
 {
 }
예제 #15
0
 /// <summary>
 /// this method handles the incoming messages from one client; 
 /// it's called by the IServerListener
 /// </summary>
 private void ProcessClientMessages(IServerTransport transport)
 {
     GiopTransportMessageHandler handler =
         new GiopTransportMessageHandler(transport, m_headerFlags);
     GiopConnectionDesc conDesc = new GiopConnectionDesc(m_bidirConnectionManager, handler);
     handler.InstallReceiver(m_transportSink, conDesc, m_serverThreadsMaxPerConnection);
     handler.ConnectionClosed +=
         new GiopTransportMessageHandler.ConnectionClosedDelegate(EndClientMessages);
     lock (m_activeClients.SyncRoot)
     {
         m_activeClients.Add(handler);
         Debug.WriteLine("added client; peer addr: " + handler.Transport.GetPeerAddress());
         Debug.WriteLine("added client; new number of active: " + m_activeClients.Count);
     }
     handler.StartMessageReception();
 }