コード例 #1
0
        public static void Main(string[] args)
        {
            Capturing capture = new Capturing();

            Tcp_packets_holder.Pairs.OnNewRequest += (pair) =>
            {
            };

            Tcp_packets_holder.Pairs.OnNewResponse += (pair) =>
            {
                var response = pair.Response;
                if (/*response.IsCompleted*/ response.Headers != null)
                {
                    WriteInfo(pair);
                }
                else
                {
                    response.OnBytesAdded += () =>
                    {
                        if (/*response.IsCompleted*/ response.Headers != null)
                        {
                            WriteInfo(pair);
                        }
                    };
                }
            };

            capture.StartCapturing(0);
        }
コード例 #2
0
 void StartSniffingDevice(int device)
 {
     capture.StopCapturing();
     capture.StartCapturing(device);
 }