예제 #1
0
        /// <summary>
        ///     Read a frame from the socket and send it to the beacon channel
        /// </summary>
        /// <param name="c2"></param>
        /// <returns></returns>
        public bool ReadAndSendTo(IC2Channel c2)
        {
            var buffer = ReadFrame();

            //if (buffer.Length <= 0) return false;
            c2.SendFrame(buffer);

            return(true);
        }
예제 #2
0
        /// <summary>
        ///     Reads a frame from the NamedPipe and sends it to the other C2 channel
        /// </summary>
        /// <param name="c2"></param>
        /// <returns>Whether the read/send were successful</returns>
        public bool ReadAndSendTo(IC2Channel c2)
        {
            var buffer = ReadFrame();

            if (buffer.Length <= 0)
            {
                return(false);
            }

            if (ExternalId == 0 && buffer.Length == 132)
            {
                ExtractId(buffer);
            }

            c2.SendFrame(buffer);

            return(true);
        }