Example #1
0
        public Client(string ipAddress, short port) : base(InitiatorType.Client)
        {
            _client = new TcpClient(ipAddress, port);

            _packetCapturer = new PacketCapturer(port);
            _packetCapturer.StartCapturing(false);
            _packetCapturer.Message += OnPacketCapturerMessage;
        }
Example #2
0
        public bool Start()
        {
            try
            {
                _listener.Start();
                _packetCapturer.StartCapturing(true);

                _client = _listener.AcceptTcpClient();

                Task.Factory.StartNew(ReadClient);
                return(true);
            }
            catch (Exception e)
            {
                OnMessage(string.Format(Resources.ExceptionMessage, e.Message));
                return(false);
            }
        }