Beispiel #1
0
        public OrientDBBinaryServerConnection(ServerConnectionOptions options, IOrientDBRecordSerializer <byte[]> serializer, ILogger logger)
        {
            _logger = logger;

            _logger.LogDebug("OrientDBBinaryServerConnection.Ctor()");
            _options    = options ?? throw new ArgumentNullException($"{nameof(options)} cannot be null.");
            _serializer = serializer ?? throw new ArgumentNullException($"{nameof(serializer)} cannot be null.");

            Open();
        }
Beispiel #2
0
        public OrientDBBinaryConnectionStream(ServerConnectionOptions options, IOrientDBLogger logger)
        {
            _connectionOptions = options;
            _logger            = logger;


            _logger.Debug($"Creating {options.PoolSize} connections to OrientDB Server {options.HostName}");
            for (var i = 0; i < options.PoolSize; i++)
            {
                _streamPool.Enqueue(CreateNetworkStream());
            }

            flowControl = new Semaphore(options.PoolSize, options.PoolSize);
        }