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); }
public AServiceServer(IServerTransport transport, IProtocol protocol, IAnnouncer announcer, IEncodableEndpoint endpoint) { this.transport = transport; this.protocol = protocol; this.announcer = announcer; this.endpoint = endpoint; }
/// <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); }
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)); }
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}"); } }
public AServiceServer(IServerTransport transport, IProtocol protocol) { this.transport = transport; this.protocol = protocol; }
public PlayerClientContext(ServerContextBase application, IServerTransport transport) : base(application, transport) { }
public InstanceClientContext(ServerContextBase application, IServerTransport transport) : base(application, transport) { }
/// <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(); }