Пример #1
0
        protected internal override void Start(AsciiTcpConnection connection)
        {
            _connection = connection;
            AsciiSendLineUnit sendUnit = new AsciiSendLineUnit(_line);

            sendUnit.Finished += new AsciiProtocolUnitDelegate(sendUnit_Finished);
            StartUnit(sendUnit, connection);
        }
Пример #2
0
        private void sendUnit_Finished(AsciiProtocolUnit unit)
        {
            AsciiSendLineUnit sendUnit = (AsciiSendLineUnit)unit;

            if (!(_lineSent = sendUnit.LineSent))
            {
                FireFinished();
            }
            else
            {
                _connection.AfterReceive    += new MethodInvoker(_connection_AfterReceive);
                _connection.LineReceived    += new LineDelegate(_connection_LineReceived);
                _connection.OperationFailed += new MethodInvoker(FireFinished);
                _connection.SkipReceivedStream();
                _connection.Receive();
            }
        }