Example #1
0
 public BNetWatcher()
 {
     bncs_stream = new BNCSStream();
     bncs_parser = new BNCSParser(bncs_stream);
     comm = new AsyncCommunicator();
     comm.onPacketReceive += bncs_stream.Handle;
     comm.onPacketReceive += handle;
 }
Example #2
0
        public BNCSParser(BNCSStream stream = null)
        {
            string[] join_patterns = Properties.Resources.join.Split(new char[2] {'\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
            join_regex = new Regex[join_patterns.Length];
            for (int i = 0; i < join_patterns.Length; i++) {
                join_regex[i] = new Regex("^" + join_patterns[i] + "$");
            }

            if (null != stream) {
                stream.OnInPacket += HandleIn;
                stream.OnOutPacket += HandleOut;
            }
        }