Exemplo n.º 1
0
        /// <summary>
        /// This Override of FrontendHandler receives data from the socket contained within args,
        /// and sends it to BackendSocket.
        /// </summary>
        /// <param name="sender">unused</param>
        /// <param name="args">a NetMQSocketEventArgs that contains a NetMqSocket for receiving data from</param>
        protected override void FrontendHandler(object sender, NetMQSocketEventArgs args)
        {
            bool more;

            do
            {
                var data = args.Socket.ReceiveFrameBytes(out more);

                if (more)
                {
                    BackendSocket.SendMoreFrame(data);
                }
                else
                {
                    BackendSocket.SendFrame(data);
                }
            } while (more);
        }
        /// <summary>
        /// This override of FrontendHandler receives data from the socket contained within args,
        /// and Sends it to BackendSocket.
        /// </summary>
        /// <param name="sender">unused</param>
        /// <param name="args">a NetMQSocketEventArgs that contains a Socket for receiving data from</param>
        protected override void FrontendHandler(object sender, NetMQSocketEventArgs args)
        {
            // TODO reuse a Msg instance here for performance
            bool more;

            do
            {
                var data = args.Socket.ReceiveFrameBytes(out more);

                if (more)
                {
                    BackendSocket.SendMoreFrame(data);
                }
                else
                {
                    BackendSocket.SendFrame(data);
                }
            } while (more);
        }