public void SingleLine03Trimmed()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.Property.SingleLine03.Substring(1));
            IDataParser parser = CreateDataParser(reader);

            AssertParsedUsingXml(parser, PropertyModel.Factory("Property", "KEY-004", "[ 1] key of MSF004 FK:0"));
        }
Exemplo n.º 2
0
        internal AudioScan(DirectoryInfo directory, SearchOption searchoption,
                           bool parseAdd, bool parseUpdate, bool removeDeadFiles,
                           string[] extensions, IEnumerable<RawTrack> existingFiles, IEnumerable<string> ignoredFiles,
                           ScanFileEventHandler parsed,
                           ScanCompletedEventHandler done)
        {
            var thread = new Thread(Run);

            _directory = directory;
            _searchoption = searchoption;

            _parseAdd = parseAdd;
            _parseUpdate = parseUpdate;
            _removeDeadFiles = removeDeadFiles;

            _parser = new MediaParser();

            _extensions = extensions;
            _existingFiles = existingFiles.ToDictionary(rt => rt.File);

            _ignoredFiles = (from s in ignoredFiles select new FileInfo(s)).ToArray();

            Parsed = parsed;
            Done = done;

            _state = ScannerState.NotRunning;

            _added = _updated = _skipped = _error = _removed = _total = 0;

            thread.Start();
        }
Exemplo n.º 3
0
        public void MultiLine13()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.EnumValue.SingleLine15);
            IDataParser parser = CreateDataParser(reader, EnumValueParser.HierarchyParser(8));

            AssertParsedUsingXml(parser, EnumValueModel.Factory("EnumValue", "MSF062-ETP-TRAIN-PROG VALUE 'P'", "Employee Training Plan Program"));
        }
        public void MultiLineLevel03()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.Property.MultiLine03);
            IDataParser parser = CreateDataParser(reader);

            AssertParsedUsingXml(parser, PropertyModel.Factory("Property", "END-DATE", "[ 11] Ending date DATE\nDB"));
        }
Exemplo n.º 5
0
        public void init(int portID, int maxConnections, int connectionsPerIP, IDataParser parser, bool DisabledProtect = false)
        {
            this._ipConnectionsCount = new ConcurrentDictionary <string, int>();

            this.parser               = parser;
            this.maximumConnections   = maxConnections;
            this.maxIpConnectionCount = connectionsPerIP;
            this.acceptedConnections  = 0;

            this.connectionListener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            try
            {
                this.connectionListener.Bind((EndPoint) new IPEndPoint(IPAddress.Any, portID));
                this.connectionListener.Listen(100);
                this.connectionListener.BeginAccept(new AsyncCallback(this.newConnectionRequest), (object)this.connectionListener);
                this.connectionListener.SendBufferSize    = GameSocketManagerStatics.BUFFER_SIZE;
                this.connectionListener.ReceiveBufferSize = GameSocketManagerStatics.BUFFER_SIZE;
            }
            catch (Exception ex)
            {
                this.Destroy();
                Console.WriteLine(ex);
                return;
            }

            this.acceptConnections = true;
        }
Exemplo n.º 6
0
        public void SingleLine11()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.EnumValue.SingleLine13);
            IDataParser parser = CreateDataParser(reader, EnumValueParser.HierarchyParser(7));

            AssertParsedUsingXml(parser, EnumValueModel.Factory("EnumValue", "RES-TY VALUE 'R'", "Resource Type"));
        }
Exemplo n.º 7
0
        public void MultiLine05()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.DataType.MultiLines05);
            IDataParser parser = CreateDataParser(reader);

            AssertParsedUsingXml(parser, DataTypeModel.Factory("DataType", "DSTRCT-CODE PIC X(4)", "[ 1] District Code MANDATORY VALUE\n(DSTRCT-CODE) ERROR\n(6534) ACTIVE\nDB,KEY:0"));
        }
Exemplo n.º 8
0
        public void SingleLine13()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.DataType.SingleLine13);
            IDataParser parser = CreateDataParser(reader);

            AssertParsedUsingXml(parser, DataTypeModel.Factory("DataType", "MSF061-MSB566-RUN-1A PIC X(4)", "[ 5] MSB566 Run Number NUMERIC RANGE (11)"));
        }
Exemplo n.º 9
0
        public void SingleLine15()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.DataType.SingleLine15);
            IDataParser parser = CreateDataParser(reader);

            AssertParsedUsingXml(parser, DataTypeModel.Factory("DataType", "MSF062-REQ-NO-RC PIC X(6)", "[ 38] Requisition number"));
        }
Exemplo n.º 10
0
        public void SingleLine09()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.DataType.SingleLine09);
            IDataParser parser = CreateDataParser(reader);

            AssertParsedUsingXml(parser, DataTypeModel.Factory("DataType", "AVAIL-SOH PIC S9(9) COMP-3", "[1851] Available SOH"));
        }
Exemplo n.º 11
0
        public void SingleLine11()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.DataType.SingleLine11);
            IDataParser parser = CreateDataParser(reader);

            AssertParsedUsingXml(parser, DataTypeModel.Factory("DataType", "SUBLEDGER-TYPE PIC X(2)", "[ 30] Subledger Account Type OPTIONAL TABLE ('SA')"));
        }
Exemplo n.º 12
0
        public void SingleLine07()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.EnumValue.SingleLine09);
            IDataParser parser = CreateDataParser(reader, EnumValueParser.HierarchyParser(5));

            AssertParsedUsingXml(parser, EnumValueModel.Factory("EnumValue", "MIMS-CONTROL VALUE 'M'", "Indicates MIMS System Control Account"));
        }
Exemplo n.º 13
0
        internal AudioScan(DirectoryInfo directory, SearchOption searchoption,
                           bool parseAdd, bool parseUpdate, bool removeDeadFiles,
                           string[] extensions, IEnumerable <RawTrack> existingFiles, IEnumerable <string> ignoredFiles,
                           ScanFileEventHandler parsed,
                           ScanCompletedEventHandler done)
        {
            var thread = new Thread(Run);

            _directory    = directory;
            _searchoption = searchoption;

            _parseAdd        = parseAdd;
            _parseUpdate     = parseUpdate;
            _removeDeadFiles = removeDeadFiles;

            _parser = new MediaParser();

            _extensions    = extensions;
            _existingFiles = existingFiles.ToDictionary(rt => rt.File);

            _ignoredFiles = (from s in ignoredFiles select new FileInfo(s)).ToArray();

            Parsed = parsed;
            Done   = done;

            _state = ScannerState.NotRunning;

            _added = _updated = _skipped = _error = _removed = _total = 0;

            thread.Start();
        }
Exemplo n.º 14
0
        public void SingleLine09()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.EnumValue.SingleLine11);
            IDataParser parser = CreateDataParser(reader, EnumValueParser.HierarchyParser(6));

            AssertParsedUsingXml(parser, EnumValueModel.Factory("EnumValue", "EGI-TYPE VALUE 'G'", "EGI type record"));
        }
Exemplo n.º 15
0
        public void MultiLine31()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.DataType.MultiLines31);
            IDataParser parser = CreateDataParser(reader);

            AssertParsedUsingXml(parser, DataTypeModel.Factory("DataType", "MSF062-DATA-2-062-PB PIC X(24)", "[ 33] Reference data 2"));
        }
Exemplo n.º 16
0
        /// <summary>
        /// Ctor.
        /// </summary>
        /// <param name="amcpTcpParser"></param>
        /// <param name="mediaParser"></param>
        public AMCPProtocolParser(IAMCPTcpParser amcpTcpParser, IDataParser mediaParser)
        {
            AmcpTcpParser = amcpTcpParser;
            AmcpTcpParser.ResponseParsed += TcpResponseParsed;

            DataParser = mediaParser;
        }
        public void SingleLineLevel17()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.Property.SingleLine17);
            IDataParser parser = CreateDataParser(reader);

            AssertParsedUsingXml(parser, PropertyModel.Factory("Property", "MSF062-DATA-2-062-PA", "[ 33] Reference data 2"));
        }
        public void MultiLineLevel29()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.Property.MultiLine29);
            IDataParser parser = CreateDataParser(reader);

            AssertParsedUsingXml(parser, PropertyModel.Factory("Property", "MSF062-BUDG-ACCT-CODE-BA", "[ 33] Account Code number ACCOUNT-CODE"));
        }
        public void SingleLineLevel13()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.Property.SingleLine13);
            IDataParser parser = CreateDataParser(reader);

            AssertParsedUsingXml(parser, PropertyModel.Factory("Property", "MSF062-CONTRACT-NO-RC", "[ 38] Contract Number"));
        }
        public void SingleLineLevel15()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.Property.SingleLine15);
            IDataParser parser = CreateDataParser(reader);

            AssertParsedUsingXml(parser, PropertyModel.Factory("Property", "MSF062-ACCOUNT-CODE-NA", "[ 33] Account Code number ACCOUNT-CODE"));
        }
        public void MultiLineLevel09()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.Property.MultiLine09);
            IDataParser parser = CreateDataParser(reader);

            AssertParsedUsingXml(parser, PropertyModel.Factory("Property", "INT-DSTRCT", "[ 30] InterDist Dist Code Ident. Target Dist MANDATORY VALUE\n(DSTRCT-CODE) ERROR\n(6534) ACTIVE"));
        }
        public void SingleLineLevel11()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.Property.SingleLine11);
            IDataParser parser = CreateDataParser(reader);

            AssertParsedUsingXml(parser, PropertyModel.Factory("Property", "MSF061-DATA-1-061-1A", "[ 5] Reference Data 1a"));
        }
        public void MultiLineLevel05()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.Property.MultiLine05);
            IDataParser parser = CreateDataParser(reader);

            AssertParsedUsingXml(parser, PropertyModel.Factory("Property", "CONTROL-ID", "[ 29] ID's Subledger,MIMS Sys & InterComp Ctl MANDATORY\nDB,KEY:0"));
        }
        public void SingleLineLevel07()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.Property.SingleLine07);
            IDataParser parser = CreateDataParser(reader);

            AssertParsedUsingXml(parser, PropertyModel.Factory("Property", "CONTROL-NUMBER", "[ 30] No Identifying MIMS System Ctl Account"));
        }
Exemplo n.º 25
0
        public void MultiLine03()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.EnumValue.MultiLine05);
            IDataParser parser = CreateDataParser(reader, EnumValueParser.HierarchyParser(3));

            AssertParsedUsingXml(parser, EnumValueModel.Factory("EnumValue", "TARGT-NO-AUTOGEN VALUE 'N'", "No Autogenerate Interdistrict Account\nEntries"));
        }
Exemplo n.º 26
0
        public void SingleLine03()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.EnumValue.SingleLine05);
            IDataParser parser = CreateDataParser(reader, EnumValueParser.HierarchyParser(3));

            AssertParsedUsingXml(parser, EnumValueModel.Factory("EnumValue", "PO-NO-ITEM VALUE 'PO'", "Purchase Order Number Item"));
        }
Exemplo n.º 27
0
        public async Task TestTwitterStorage()
        {
            IDataParser Parser = DataParserFactory.CreateParser("Twitter", "#freebandnames");

            Assert.IsNotNull(Parser);

            Assert.IsInstanceOfType(Parser, typeof(IDataParser), $"{nameof(Parser)} must inherit {nameof(IDataParser)}");
            Assert.IsInstanceOfType(Parser, typeof(DataParserBase), $"{nameof(Parser)} must inherit {nameof(DataParserBase)}");
            Assert.IsInstanceOfType(Parser, typeof(TwitterParser), $"{nameof(Parser)} must be a {nameof(DataParser.DataParsers.TwitterParser)}");

            Assert.IsNotNull(Parser.ProviderName, $"{nameof(Parser.ProviderName)} must have a value assigned (\"Twitter\").");
            Assert.AreEqual(Parser.ProviderName, "Twitter", $"{nameof(Parser.ProviderName)} must have a value (\"Twitter\").");

            Assert.IsNotNull(Parser.SearchTerm, $"{nameof(Parser.SearchTerm)} must have a value assigned (\"#freebandnames\").");
            Assert.AreEqual("#freebandnames", Parser.SearchTerm, $"{Parser.SearchTerm} must have a value (\"#freebandnames\").");

            TwitterParser TwitterParser = (TwitterParser)Parser;

            DataModel Model = TwitterParser.ParseResult(Resources.SampleTwitterJson);

            Assert.IsNotNull(Model, $"{nameof(Model)} must not be null. This indicates that {nameof(TwitterParser.ParseResult)} failed.");

            using (HttpClient Client = new HttpClient())
            {
                string JsonModel = new JavaScriptSerializer().Serialize(Model);
                Assert.IsNotNull(JsonModel, $"{JsonModel} must be a valid JSON string.");

                StringContent       Content         = new StringContent(JsonModel, Encoding.UTF8, "application/json");
                HttpResponseMessage ResponseMessage = await Client.PostAsync("http://localhost:46778/News", Content);

                Assert.IsTrue(ResponseMessage.IsSuccessStatusCode, $"{ResponseMessage.IsSuccessStatusCode} must be true. Otherwise it indicates a failed REST POST request.");
            }
        }
        public void PropertyContainingPic()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.Property.PropertyContainingReservedWord);
            IDataParser parser = CreateDataParser(reader);

            AssertParsedUsingXml(parser, PropertyModel.Factory("Property", "LST-CON-PICK-NO", "[ 11] Last Consolidate Picking Slip Number DB"));
        }
        public void SingleLineLevel19()
        {
            Reader      reader = Reader.CreateStringReader(ExampleStrings.Property.SingleLine19);
            IDataParser parser = CreateDataParser(reader);

            AssertParsedUsingXml(parser, PropertyModel.Factory("Property", "MSF062-TOP-PAR-PA-PB", "[ 33] Parent Account Code"));
        }
Exemplo n.º 30
0
 public ProjectResult TryBuildProject(IDocument doc, Uri uri, IDataParser provider)
 {
     try
     {
         var title                 = provider.GetTitle(doc);
         var location              = provider.GetLocation(doc);
         var referenceNumber       = provider.GetReferenceNumber(doc);
         var startingDate          = provider.GetStartingDate(doc);
         var duration              = provider.GetDuration(doc);
         var position              = provider.GetPosition(doc);
         var tasks                 = provider.GetTasks(doc);
         var qualifications        = provider.GetQualifications(doc);
         var advantages            = provider.GetAdvantages(doc);
         var incomeInformation     = provider.GetIncomeInformation(doc);
         var projectInformation    = provider.GetProjectInformation(doc);
         var employerInformation   = provider.GetEmployerInformation(doc);
         var employmentInformation = provider.GetEmploymentInformation(doc);
         var contact               = provider.GetContact(doc);
         var project               = new Project(title, location, referenceNumber, startingDate, duration, position, tasks,
                                                 qualifications, advantages, incomeInformation, projectInformation, employerInformation,
                                                 employmentInformation, contact, uri);
         return(new ProjectResult(true, null, project));
     }
     catch (Exception ex)
     {
         return(new ProjectResult(false, ex, null));
     }
 }
Exemplo n.º 31
0
        private IDataParser GetParser(EDataParserType type)
        {
            IDataParser result = null;

            this.m_dicDataParsers.TryGetValue(type, out result);
            return(result);
        }
Exemplo n.º 32
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ConnectionInformation" /> class.
 /// </summary>
 /// <param name="socket">The socket.</param>
 /// <param name="parser">The parser.</param>
 /// <param name="channelId">The channel identifier.</param>
 public ConnectionInformation(Socket socket, IDataParser parser, uint channelId)
 {
     _socket = socket;
     socket.SendBufferSize = GameSocketManagerStatics.BufferSize;
     Parser = parser;
     _buffer = new byte[GameSocketManagerStatics.BufferSize];
     _remoteEndPoint = socket.RemoteEndPoint;
     _connected = true;
     ChannelId = channelId;
 }
Exemplo n.º 33
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="ConnectionData" /> class.
 /// </summary>
 /// <param name="socket">The socket.</param>
 /// <param name="parser">The parser.</param>
 /// <param name="channelId">The channel identifier.</param>
 public ConnectionData(Socket socket, IDataParser parser, uint channelId)
 {
     _socket = socket;
     socket.SendBufferSize = SocketConnectionSettings.BufferSize;
     Parser = parser;
     _buffer = new byte[SocketConnectionSettings.BufferSize];
     _remoteEndPoint = socket.RemoteEndPoint;
     _connected = true;
     ChannelId = channelId;
 }
Exemplo n.º 34
0
		public void init(int portID, int maxConnections, int connectionsPerIP, IDataParser parser, bool disableNaglesAlgorithm)
		{
			this.parser = parser;
			this.disableNagleAlgorithm = disableNaglesAlgorithm;
			this.initializeFields();
			this.maximumConnections = maxConnections;
			this.portInformation = portID;
			this.maxIpConnectionCount = connectionsPerIP;
			this.acceptedConnections = 0;
			this.prepareConnectionDetails();
		}
Exemplo n.º 35
0
        /// <summary>
        ///     Creates a new Connection witht he given information
        /// </summary>
        /// <param name="dataStream">The Socket of the connection</param>
        /// <param name="connectionID">The id of the connection</param>
        public ConnectionInformation(int connectionID, Socket dataStream, SocketManager manager, IDataParser parser, string ip)
        {
            this.parser = parser;
            buffer = new byte[GameSocketManagerStatics.BUFFER_SIZE];
            this.manager = manager;
            dataSocket = dataStream;
            dataSocket.SendBufferSize = GameSocketManagerStatics.BUFFER_SIZE;
            this.ip = ip;
            sendCallback = sentData;
            this.connectionID = connectionID;
            if (connectionChanged != null)
                connectionChanged.Invoke(this, ConnectionState.OPEN);

        }
Exemplo n.º 36
0
        /// <summary>
        ///     Initializes the connection instance
        /// </summary>
        /// <param name="portID">The ID of the port this item should listen on</param>
        /// <param name="maxConnections">The maximum amount of connections</param>
        public void init(int portID, int maxConnections, int connectionsPerIP, IDataParser parser,  bool disableNaglesAlgorithm)
        {
            this._ipConnectionsCount = new ConcurrentDictionary<string, int>();

            this.parser = parser;
            disableNagleAlgorithm = disableNaglesAlgorithm;
            maximumConnections = maxConnections;
            portInformation = portID;
            maxIpConnectionCount = connectionsPerIP;
            prepareConnectionDetails();
            _acceptedConnections = 0;
            log.Info("Successfully setup GameSocketManager on port (" + portID + ")!");
            log.Info("Maximum connections per IP has been set to [" + connectionsPerIP + "]!");
        }
Exemplo n.º 37
0
        /// <summary>
        /// Creates a new Connection witht he given information
        /// </summary>
        /// <param name="dataStream">The Socket of the connection</param>
        /// <param name="connectionID">The id of the connection</param>
        public ConnectionInformation(Socket dataStream, int connectionID, SocketManager manager, IDataParser parser, string ip, byte[] buffer)
        {
            this.parser = parser;
            this.buffer = buffer;
            this.manager = manager;
            this.dataSocket = dataStream;
            this.dataSocket.SendBufferSize = GameSocketManagerStatics.BUFFER_SIZE;
            this.ip = ip;
            this.connectionID = connectionID;
            this.sendCallback = new AsyncCallback(sentData);
            this.receiveCallback = new AsyncCallback(incomingDataPacket);

            if (connectionChanged != null)
                connectionChanged.Invoke(this, ConnectionState.open);
        }
Exemplo n.º 38
0
 /// <summary>
 /// Initializes the specified port identifier.
 /// </summary>
 /// <param name="portId">The port identifier.</param>
 /// <param name="maxConnections">The maximum connections.</param>
 /// <param name="connectionsPerIp">The connections per ip.</param>
 /// <param name="antiDdoS">The antiDDoS status</param>
 /// <param name="parser">The parser.</param>
 /// <param name="disableNaglesAlgorithm">if set to <c>true</c> [disable nagles algorithm].</param>
 public void Init(int portId, int maxConnections, int connectionsPerIp, bool antiDdoS, IDataParser parser, bool disableNaglesAlgorithm)
 {
     _parser = parser;
     _disableNagleAlgorithm = disableNaglesAlgorithm;
     MaximumConnections = maxConnections;
     _portInformation = portId;
     AcceptedConnections = 0;
     MaxIpConnectionCount = connectionsPerIp;
     AntiDDosStatus = antiDdoS;
     if (_portInformation < 0)
         throw new ArgumentOutOfRangeException("port", _portInformation, "Port must be 0 or more.");
     if (_listener != null)
         throw new InvalidOperationException("Already listening.");
     PrepareConnectionDetails();
 }
Exemplo n.º 39
0
        public AudioScanner(IDataParser parser, DirectoryInfo directory, SearchOption searchoption,
                            params string[] extensions)
        {
            if (parser == null)
                throw new ArgumentNullException("parser");
            if (directory == null)
                throw new ArgumentNullException("directory");

            _parser = parser;
            _directory = directory;
            _searchoption = searchoption;

            _extensionList = new ExtensionList(extensions);
            MediaLibrary = new Library();
        }
Exemplo n.º 40
0
        /// <summary>
        /// Creates a new Connection witht he given information
        /// </summary>
        /// <param name="dataStream">The Socket of the connection</param>
        /// <param name="connectionID">The id of the connection</param>
        public ConnectionInformation(Socket dataStream, int connectionID, SocketManager manager, IDataParser parser, string ip)
        {
            this.parser = parser;
            this.buffer = new byte[GameSocketManagerStatics.BUFFER_SIZE];
            this.manager = manager;
            this.dataSocket = dataStream;
            this.dataSocket.SendBufferSize = GameSocketManagerStatics.BUFFER_SIZE;
            this.ip = ip;
            this.connectionID = connectionID;
            this.sendCallback = new AsyncCallback(sentData);

            if (connectionChanged != null)
                connectionChanged.Invoke(this, ConnectionState.open);

            MessageLoggerManager.AddMessage(null, connectionID, LogState.ConnectionOpen);
        }
Exemplo n.º 41
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ConnectionInformation"/> class.
 /// </summary>
 /// <param name="dataStream">The data stream.</param>
 /// <param name="connectionId">The connection identifier.</param>
 /// <param name="parser">The parser.</param>
 /// <param name="ip">The ip.</param>
 public ConnectionInformation(Socket dataStream, int connectionId, IDataParser parser,
                              string ip)
 {
     try
     {
         Parser = parser;
         _buffer = new byte[GameSocketManagerStatics.BufferSize];
         _dataSocket = dataStream;
         _dataSocket.SendBufferSize = GameSocketManagerStatics.BufferSize;
         _ip = ip;
         _connectionId = connectionId;
         if (ConnectionChanged != null)
             ConnectionChanged(this, ConnectionState.Open);
     }
     catch
     {
     }
 }
Exemplo n.º 42
0
 /// <summary>
 /// Initializes the specified port identifier.
 /// </summary>
 /// <param name="portId">The port identifier.</param>
 /// <param name="maxConnections">The maximum connections.</param>
 /// <param name="connectionsPerIp">The connections per ip.</param>
 /// <param name="antiDDoS">The antiDDoS status</param>
 /// <param name="parser">The parser.</param>
 /// <param name="disableNaglesAlgorithm">if set to <c>true</c> [disable nagles algorithm].</param>
 public void Init(int portId, int maxConnections, int connectionsPerIp, bool antiDDoS, IDataParser parser, bool disableNaglesAlgorithm)
 {
     _parser = parser;
     _disableNagleAlgorithm = disableNaglesAlgorithm;
     InitializeFields();
     MaximumConnections = maxConnections;
     _portInformation = portId;
     MaxIpConnectionCount = connectionsPerIp;
     AntiDDosStatus = antiDDoS;
     _acceptedConnections = 0;
     PrepareConnectionDetails();
 }
Exemplo n.º 43
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        protected IDataParser CreateConverter()
        {
            if (_convert == null)
            {
                ScriptContainer container = new ScriptContainer(_engine, Guid.Empty, _script, _enableDebug, _referencedAssemblies.Select(a => a.GetName()));
                _convert = (IDataParser)ScriptUtils.GetInstance(container, _classname);

                if (_state != null)
                {
                    IPersistDynamicNode persist = _convert as IPersistDynamicNode;
                    if (persist != null)
                    {
                        persist.SetState(_state, GetLogger());
                    }
                }
            }

            return _convert;
        }
Exemplo n.º 44
0
 /// <summary>
 /// Initializes the connection instance
 /// </summary>
 /// <param name="portID">The ID of the port this item should listen on</param>
 /// <param name="maxConnections">The maximum amount of connections</param>
 public void init(int portID, int maxConnections, int connectionsPerIP, IDataParser parser, bool disableNaglesAlgorithm)
 {
     Out.writeLine("Starting up socket manager on port [" + portID + "] with [" + maxConnections + "] as the maximum connection count", Out.logFlags.ImportantLogLevel);
     Out.writeLine("Maximum connections per ip [" + connectionsPerIP + "]", Out.logFlags.ImportantLogLevel);
     this.parser = parser;
     this.disableNagleAlgorithm = disableNaglesAlgorithm;
     initializeFields();
     maximumConnections = maxConnections;
     portInformation = portID;
     maxIpConnectionCount = connectionsPerIP;
     acceptedConnections = 0;
     prepareConnectionDetails();
     Out.writeLine("Connection details set up!", Out.logFlags.ImportantLogLevel);
 }
Exemplo n.º 45
0
 public void Init(int portID, int maxConnections, int connectionsPerIP, IDataParser parser, bool disableNaglesAlgorithm)
 {
     clients = new Dictionary<int, Client>();
     this.parser = parser;
     this.parser = parser.Clone() as IDataParser;
     this.InitializeFields();
     this.MaximumConnections = maxConnections;
     this.portInformation = portID;
     this.MaxIpConnectionCount = connectionsPerIP;
     this.acceptedConnections = 0;
     this.PrepareConnectionDetails();
 }
Exemplo n.º 46
0
 public AudioScanner(IDataParser parser, DirectoryInfo directory, SearchOption searchoption)
     : this(parser, directory, searchoption, ".mp3", ".wma")
 {
 }
Exemplo n.º 47
0
 public AudioScanner(IDataParser parser, string directory, SearchOption searchoption, params string[] extensions)
     : this(parser, new DirectoryInfo(directory), searchoption, extensions)
 {
 }
Exemplo n.º 48
0
 public AudioScanner(IDataParser parser, DirectoryInfo directory)
     : this(parser, directory, SearchOption.AllDirectories)
 {
 }
Exemplo n.º 49
0
 public AudioScanner(IDataParser parser, string directory, SearchOption searchoption)
     : this(parser, new DirectoryInfo(directory), searchoption)
 {
 }
Exemplo n.º 50
0
 public FileController(IDataParser dataParser)
 {
     _dataParser = dataParser;
 }
Exemplo n.º 51
0
 public AudioScanner(IDataParser parser, string directory)
     : this(parser, new DirectoryInfo(directory))
 {
 }