Example #1
0
        public void Send(RequestBase request, CustomIPEndPoint endPoint)
        {
            var socket = SetupSocket(endPoint.Ip, endPoint.Port);

            _serializationService.SerializeToStream(new NetworkStream(socket), request);

            socket.Shutdown(SocketShutdown.Send);
        }
Example #2
0
        public void Start(CustomIPEndPoint endPoint)
        {
            _acceptSocket = new Socket(SocketType.Stream, ProtocolType.Tcp);
            _acceptSocket.Bind(new IPEndPoint(endPoint.Ip, endPoint.Port));
            _acceptSocket.Listen(1);

            Task.Run((Action)HandleConnection);
        }
        public void Send(ResponseBase response, CustomIPEndPoint responseEndPoint)
        {
            var socket = new Socket(SocketType.Stream, ProtocolType.Tcp);

            socket.Connect(new IPEndPoint(responseEndPoint.Ip, responseEndPoint.Port));

            _serializationService.SerializeToStream(new NetworkStream(socket), response);
            socket.Shutdown(SocketShutdown.Send);
        }
Example #4
0
        public void Execute()
        {
            StartTime = DateTime.Now;
            Status    = ExecutorStatus.Running;

            var endPoint = _networkItemsFactory.GetEndPoint();
            var request  = CreateRequest();

            request.ResponseEndPoint = endPoint;
            request.SessionId        = _query.SessionId;

            var remoteEndPoint = new CustomIPEndPoint {
                Ip = IPAddress.Parse(_query.Ip).Address, Port = _query.Port
            };

            _networkItemsFactory.GetRequestSender().Send(request, remoteEndPoint);

            var waiter = GetWaiter();

            waiter.Start(endPoint);
            waiter.DataReceived += OnResponseReceived;
        }
Example #5
0
 public ConnectionQuery(CustomIPEndPoint responseEndPoint) : base(responseEndPoint)
 {
 }
Example #6
0
 public DownloadFileQuery(CustomIPEndPoint responsEndPoint) : base(responsEndPoint)
 {
 }
Example #7
0
 public GetFileNamesQuery(CustomIPEndPoint responseEndPoint) : base(responseEndPoint)
 {
 }
Example #8
0
 public QueryBase(CustomIPEndPoint responsEndPoint)
 {
     ResponseEndPoint = responsEndPoint;
 }