コード例 #1
0
ファイル: ClientConnector.cs プロジェクト: tyronebj/IPC.Bond
 internal ClientConnector(
     IClientConnector <BufferPool.ConstBuffer, BufferPool.ConstBuffer> impl,
     Func <IComponent, Serializer> serializerMaker)
     : base(impl)
 {
     _serializerMaker = serializerMaker;
 }
コード例 #2
0
ファイル: SLPClientConnector.cs プロジェクト: juandrn/NetXP
        public SLPClientConnector(
            INameResolverFactory <IAsymetricCrypt> asymetricCryptFactory,
            ISymetricCrypt symetric,
            ISerializerFactory serializeT,
            ILogger logger,
            IHash hash,
            IPersistentPrivateKeyProvider persistentPrivateKeyProvider,
            ICompression compression,
            ISecureProtocolHandshake secureProtocolHandshake,
            IClientConnector clientConnector,
            IOptions <SLJPOption> sljpOptions = null
            )
        {
            this.asymetricForDecrypt = asymetricCryptFactory.Resolve();
            this.asymetricToEncrypt  = asymetricCryptFactory.Resolve();
            this.firstAsymetricHandshakeToDecrypt = asymetricCryptFactory.Resolve();
            this.firstAsymetricHandshakeToEncrypt = asymetricCryptFactory.Resolve();

            this.textPlainTCPChannel = clientConnector;

            this.symetric   = symetric;
            this.serializeT = serializeT.Resolve(SerializerType.Json);
            this.logger     = logger;
            this.hash       = hash;
            this.IPersistentPrivateKeyProvider = persistentPrivateKeyProvider;
            this.compression             = compression;
            this.secureProtocolHandshake = secureProtocolHandshake;
            var SecurityMaxSizeToReceive = sljpOptions.Value.SecurityMaxSizeToReceive;

            this.sljpOptions = sljpOptions.Value ?? new SLJPOption();
        }
コード例 #3
0
        public IClientConnector Start(IApplication application)
        {
            var port = PortFinder.FindPort(5000);

            _application = application;

            BaseAddress = "http://localhost:" + port;

            var webSockets = new WebSocketsHandler();

            _commands = new CommandRunner(application);


            Client = new ClientConnector(webSockets, _commands.HandleJson)
            {
                WebSocketsAddress = $"ws://127.0.0.1:{port}"
            };

            startWebServer(port, webSockets);

#if DEBUG
            _watcher = new AssetFileWatcher(Client);
            _watcher.Start();
#endif

            return Client;
        }
コード例 #4
0
        public IClientConnector Start(IApplication application)
        {
            var port = PortFinder.FindPort(5000);

            _application = application;

            BaseAddress = "http://localhost:" + port;

            var webSockets = new WebSocketsHandler();

            _commands = new CommandRunner(application);


            Client = new ClientConnector(webSockets, _commands.HandleJson)
            {
                WebSocketsAddress = $"ws://127.0.0.1:{port}"
            };

            startWebServer(port, webSockets);

#if DEBUG
            _watcher = new AssetFileWatcher(Client);
            _watcher.Start(_input);
#endif

            return(Client);
        }
コード例 #5
0
        public IClientConnector Start(IApplication application, WebApplicationConfiguration additionalConfiguration = null)
        {
            var port     = additionalConfiguration?.Port ?? PortFinder.FindPort(5000);
            var hostname = additionalConfiguration?.Hostname ?? "localhost";

            _application = application;

            BaseAddress = $"http://{hostname}:{port}";

            var webSockets = new WebSocketsHandler();

            _commands = new CommandRunner(application);


            Client = new ClientConnector(webSockets, _commands.HandleJson)
            {
                WebSocketsAddress = $"ws://{hostname}:{port}"
            };

            startWebServer(hostname, port, webSockets);

#if DEBUG
            _watcher = new AssetFileWatcher(Client);
            _watcher.Start(_input);
#endif

            return(Client);
        }
コード例 #6
0
ファイル: Client.cs プロジェクト: spikensbror-dotnet/nsonic
 public Client(IClientConnector connector
               , ITcpClient tcpClient
               )
 {
     this.connector = connector;
     this.tcpClient = tcpClient;
 }
コード例 #7
0
ファイル: HomeEndpoint.cs プロジェクト: jstclair/Storyteller
 public HomeEndpoint(IClientConnector connector, StorytellerContext context, IPersistenceController persistence, IApplicationFiles files)
 {
     _connector   = connector;
     _context     = context;
     _persistence = persistence;
     _files       = files;
 }
コード例 #8
0
        public AssetFileWatcher(IClientConnector connector)
        {
            _connector = connector;


            _watcher       = new FileChangeWatcher(FindRootFolder(), FileSet.Shallow("bundle.js"), this);
            _watcherAssets = new FileChangeWatcher(FindClientFolder().AppendPath("public"), FileSet.Everything(), this);
        }
コード例 #9
0
ファイル: ucServiceConfig.cs プロジェクト: wotangjing/ImcTF
 private void EnsureClient()
 {
     if (m_WsDualClient == null || m_WsDualClient.Factory.State != CommunicationState.Opened)
     {
         m_WsDualClient = new WsDualClient(MyClients.CurrentBinding, this);
         client         = m_WsDualClient.ClientConnector;
     }
 }
コード例 #10
0
        public async Task <IClientConnector> Accept()
        {
            var socket = await this.tcpListener.AcceptSocketAsync();

            IClientConnector tcpClient = this.clientConnectorFactory.Create(socket);

            return(tcpClient);
        }
コード例 #11
0
        // ENDSAMPLE
        public AssetFileWatcher(IClientConnector connector)
        {
            _connector = connector;

            var path = Directory.GetCurrentDirectory().AppendPath("bundle.js");

            _watcher = new FileChangeWatcher(path.ParentDirectory(), FileSet.Shallow("bundle.js"), this);
        }
コード例 #12
0
        public AssetFileWatcher(IClientConnector connector)
        {
            _connector = connector;


            _watcher = new FileChangeWatcher(FindRootFolder(), FileSet.Shallow("bundle.js"), this);
            _watcherAssets = new FileChangeWatcher(FindClientFolder().AppendPath("public"), FileSet.Everything(), this);
        }
コード例 #13
0
 public PersistenceController(ILogger logger, IClientConnector client, ISpecFileWatcher watcher,
                              ISystemTime systemTime)
 {
     _logger     = logger;
     _client     = client;
     _watcher    = watcher;
     _systemTime = systemTime;
 }
コード例 #14
0
        // ENDSAMPLE
        public AssetFileWatcher(IAssetFinder finder, IClientConnector connector)
        {
            _connector = connector;

            var asset = finder.FindAsset("bundle.js");
            var path  = asset.File.Path;

            _watcher = new FileChangeWatcher(path.ParentDirectory(), FileSet.Shallow("bundle.js"), this);
        }
コード例 #15
0
ファイル: ConnectionClient.cs プロジェクト: prepare/deveeldb
        public ConnectionClient(IClientConnector connector)
        {
            if (connector == null)
                throw new ArgumentNullException("connector");

            Connector = connector;
            Processor = connector.CreateProcessor();
            OwnsConnector = false;
        }
コード例 #16
0
ファイル: HomeEndpoint.cs プロジェクト: mingabire/Storyteller
 public HomeEndpoint(IClientConnector connector, StorytellerContext context, FubuHtmlDocument document, IPersistenceController persistence, IAssetTagBuilder tags, IFubuApplicationFiles files)
 {
     _connector = connector;
     _context = context;
     _document = document;
     _persistence = persistence;
     _tags = tags;
     _files = files;
 }
コード例 #17
0
	// ENDSAMPLE
        public AssetFileWatcher(IAssetFinder finder, IClientConnector connector)
        {
            _connector = connector;

            var asset = finder.FindAsset("bundle.js");
            var path = asset.File.Path;

            _watcher = new FileChangeWatcher(path.ParentDirectory(), FileSet.Shallow("bundle.js"), this);
        }
コード例 #18
0
        public Client(string ip, int port, IServerDataReceiver receiver, IClientConnector connector, ILogger logger)
        {
            this.isReady     = IPAddress.TryParse(ip, out host);
            this.isConnected = false;

            this.port      = port;
            this.receiver  = receiver;
            this.connector = connector;
            this.logger    = logger;
        }
コード例 #19
0
        public AvailableServersViewModel(IClientConnector connector, IFCWebServiceProvider webServiceProvider, FCClientNetworkData clientNetworkData, MulticastReceiver multicastReceiver)
        {
            _clientConnector       = connector;
            _webServiceProvider    = webServiceProvider;
            _availableServers      = new List <ServerInfo>();
            this.ClientNetworkData = clientNetworkData;

            ClientNetworkData.AuthorizationToken = _webServiceProvider.Authorize("abc", "def").Result;
            _multicastReceiver = multicastReceiver;
        }
コード例 #20
0
 public HomeEndpoint(IClientConnector connector, StorytellerContext context, FubuHtmlDocument document,
                     IPersistenceController persistence, IAssetTagBuilder tags, IFubuApplicationFiles files)
 {
     _connector   = connector;
     _context     = context;
     _document    = document;
     _persistence = persistence;
     _tags        = tags;
     _files       = files;
 }
コード例 #21
0
ファイル: ConnectionClient.cs プロジェクト: deveel/deveeldb
        public ConnectionClient(IClientConnector connector, DeveelDbConnectionStringBuilder settings)
        {
            if (connector == null)
                throw new ArgumentNullException("connector");

            Settings = settings;
            Connector = connector;
            Processor = connector.CreateProcessor();
            OwnsConnector = false;
        }
コード例 #22
0
ファイル: Engine.cs プロジェクト: drminor/FractalStudio
        public Engine()
        {
            _clientConnector = null;
            _jobs            = new Dictionary <int, IJob>();
            _cts             = new CancellationTokenSource();

            _haveWork    = new ManualResetEvent(false);
            WaitDuration = DefaultWaitDuration;

            _nextJobId  = 0;
            _nextJobPtr = 0;
        }
コード例 #23
0
        public ConnectionClient(IClientConnector connector, DeveelDbConnectionStringBuilder settings)
        {
            if (connector == null)
            {
                throw new ArgumentNullException("connector");
            }

            Settings      = settings;
            Connector     = connector;
            Processor     = connector.CreateProcessor();
            OwnsConnector = false;
        }
コード例 #24
0
ファイル: ClientProxyConnector.cs プロジェクト: juandrn/NetXP
        public ClientProxyConnector(
            IClientConnectorFactoryProducer clientConnectorFactoryProducer,
            IOptions <ProxyOptions> proxyOptions,
            ILogger logger
            )
        {
            this.clientConnector = clientConnectorFactoryProducer.CreateClient(ConnectorFactory.TransmissionControlProtocol)
                                   .Create();

            this.proxyOptions = proxyOptions.Value;
            this.logger       = logger;
        }
コード例 #25
0
ファイル: Engine.cs プロジェクト: drminor/FractalStudio
        public void Start(IClientConnector clientConnector)
        {
            _clientConnector = clientConnector;

            Task.Run(() => SendProcessor(_sendQueue, _cts.Token), _cts.Token);

            _subJobProcessors = new SubJobProcessor[NUMBER_OF_SUB_PROCESSORS];
            for (int wpCntr = 0; wpCntr < NUMBER_OF_SUB_PROCESSORS; wpCntr++)
            {
                _subJobProcessors[wpCntr] = new SubJobProcessor(_workQueue, _sendQueue);
                _subJobProcessors[wpCntr].Start();
            }

            Task.Run(() => QueueWork(_workQueue, _cts.Token), _cts.Token);
        }
コード例 #26
0
ファイル: SLPServerConnector.cs プロジェクト: juandrn/NetXP
        public async Task <IClientConnector> Accept()
        {
            var socket = await tcpServer.Accept();

            IClientConnector secureClient = clientConnectorFactoryProducer
                                            .CreateClient(ConnectorFactory.SecureLitleProtocol)
                                            .Create(socket);

            try
            {
                //Receive PublicKey And Send Their PublicKey
                secureClient.Receive(aLittleBuffer, 0, aLittleBuffer.Length);
            }
            catch (NetXP.NetStandard.Network.LittleJsonProtocol.SLPException)
            {
                secureClient?.Disconnect();
                throw;
            }

            return(secureClient);
        }
コード例 #27
0
        static void Main(string[] args)
        {
            _engine     = new Engine();
            _coordsMath = new CoordsMath();
            _curCoords  = GetInitialCoords();

            IClientConnector clientConnector = null;

            _engine.Start(clientConnector);

            Console.Write("Enter Command: ");
            string com = Console.ReadLine();

            com = com.ToLower().Trim();

            while (com != "quit")
            {
                Request request = ParseCom(com);

                if (request == null)
                {
                    Console.WriteLine("Command not recognized.");
                }
                else
                {
                    ProcessRequest(request);
                }

                Console.Write("Enter Command: ");
                com = Console.ReadLine();
            }

            Console.WriteLine("Quitting, press return key to exit.");
            _engine.Stop();

            Console.Read();
        }
コード例 #28
0
 internal DeveelDbConnection(IClientConnector connector)
 {
     Client = new ConnectionClient(connector);
     RowCache = new LocalRowCache(this);
 }
コード例 #29
0
 public ClientConnectorActivator(IClientConnector connector, IRemoteController controller)
 {
     _connector  = connector;
     _controller = controller;
 }
コード例 #30
0
 public FixtureController(IClientConnector client, IFixtureFileWatcher watcher)
 {
     _client = client;
     _watcher = watcher;
 }
コード例 #31
0
 internal DeveelDbConnection(IClientConnector connector, DeveelDbConnectionStringBuilder settings)
 {
     Client = new ConnectionClient(connector,settings);
     connectionString = settings;
     RowCache = new LocalRowCache(this);
 }
コード例 #32
0
 public FixtureController(IClientConnector client, IFixtureFileWatcher watcher)
 {
     _client  = client;
     _watcher = watcher;
 }
コード例 #33
0
 public ClientConnectorActivator(IClientConnector connector, IRemoteController controller)
 {
     _connector = connector;
     _controller = controller;
 }
コード例 #34
0
ファイル: ucServiceConfig.cs プロジェクト: yonglehou/ImcTF
 private void EnsureClient()
 {
     if (m_WsDualClient == null || m_WsDualClient.Factory.State != CommunicationState.Opened)
     {
         m_WsDualClient = new WsDualClient(MyClients.CurrentBinding, this);
         client = m_WsDualClient.ClientConnector;
     }
 }
コード例 #35
0
 public PersistenceController(IClientConnector client, ISpecFileWatcher watcher, IFixtureController fixtures)
 {
     _client   = client;
     _watcher  = watcher;
     _fixtures = fixtures;
 }
コード例 #36
0
 internal DeveelDbConnection(IClientConnector connector, DeveelDbConnectionStringBuilder settings)
     : this(settings) {
     Client = new ConnectionClient(connector, settings);
 }
コード例 #37
0
 // ENDSAMPLE
 public AssetFileWatcher(IAssetFinder finder, IClientConnector connector)
 {
     _finder = finder;
     _connector = connector;
 }
コード例 #38
0
 internal DeveelDbConnection(IClientConnector connector, DeveelDbConnectionStringBuilder settings)
     : this(settings)
 {
     Client = new ConnectionClient(connector,settings);
 }
コード例 #39
0
ファイル: HomeEndpoint.cs プロジェクト: jawn/Storyteller
 public HomeEndpoint(IClientConnector connector, StorytellerContext context, IPersistenceController persistence)
 {
     _connector   = connector;
     _context     = context;
     _persistence = persistence;
 }
コード例 #40
0
 public PersistenceController(IClientConnector client, ISpecFileWatcher watcher)
 {
     _client  = client;
     _watcher = watcher;
 }
コード例 #41
0
 IClientAccessor <Request, Response> ITransport <Request, Response> .ConnectClient(
     string name, bool async, TimeSpan timeout, IClientConnector <Request, Response> connector)
 {
     return(ConnectClient(name, async, timeout, connector as ClientConnector));
 }