예제 #1
0
        static public bool ReplyBadPacket( IController ctrl, uint flags )
        {
            //What is this for? Nack + Ping?  What can the TinyCLR possibly do with this information?
            OutgoingMessage msg = new OutgoingMessage( ctrl, new WireProtocol.Converter(), Commands.c_Monitor_Ping, Flags.c_NonCritical | Flags.c_NACK | flags, null );

            return msg.Send();
        }
        static public bool ReplyBadPacket(IController ctrl, uint flags)
        {
            //What is this for? Nack + Ping?  What can the TinyCLR possibly do with this information?
            OutgoingMessage msg = new OutgoingMessage(ctrl, new WireProtocol.Converter(), Commands.c_Monitor_Ping, Flags.c_NonCritical | Flags.c_NACK | flags, null);

            return(msg.Send());
        }
예제 #3
0
        public void SendOutgoing(string[] args)
        {
            string sourceFile = args.GetRequiredValue(0);
            string smtpServer = args.GetRequiredValue(1);

            OutgoingMessage outgoing = this.Agent.ProcessOutgoing(File.ReadAllText(sourceFile));

            outgoing.Send(smtpServer);
        }
예제 #4
0
        public static void RunOutgoing()
        {
            SocketAddress addr      = null;
            int           sentCount = 0;

            try {
                int  runningCounter = 0;
                long lastTime       = CurrentTime;
                for (int i = 0; i < messageCount; i++)
                {
                    long currentTime = CurrentTime;
                    long interval    = currentTime - lastTime;
                    if (interval > 1000)
                    {
                        lastTime = currentTime;
                        Logit("Sent " + sentCount + " messages" + " in the last " + interval + "ms");
                        sentCount = 0;
                    }
                    OutgoingMessage outMessage = new OutgoingMessage();
                    Debug.Assert(rdpConnection != null, "In TestRDPClient.RunOutgoing, rdpConnection is null!");
                    outMessage.Write("Hello World from CLIENT! - MSG " + runningCounter++);
                    bool trying = true;
                    while (trying)
                    {
                        try {
                            outMessage.Send(rdpConnection);
                            trying = false;
                        }
                        catch (Exception e) {
                            if (e.Message == "Error - insufficient resources to send data")
                            {
                                Thread.Sleep(10);
                            }
                            else
                            {
                                throw;
                            }
                        }
                    }
                    sentCount++;
                }
                Console.WriteLine("RunOutgoing sent a total of " + messageCount + " messages");
            }
            catch (Exception e) {
                Logit("TestRDPClient.RunOutgoing got error: " + e.ToString());
                Logit("TestRDPClient.RunOutgoing sentCount = " + sentCount);
            }
        }
예제 #5
0
        public bool Reply( Converter converter, uint flags, object payload )
        {
            
            OutgoingMessage msgReply = new OutgoingMessage( this, converter, flags, payload );

            return msgReply.Send();
        }
        public bool Reply(Converter converter, uint flags, object payload)
        {
            OutgoingMessage msgReply = new OutgoingMessage(this, converter, flags, payload);

            return(msgReply.Send());
        }