public void Send(RequestBase request, CustomIPEndPoint endPoint) { var socket = SetupSocket(endPoint.Ip, endPoint.Port); _serializationService.SerializeToStream(new NetworkStream(socket), request); socket.Shutdown(SocketShutdown.Send); }
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); }
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; }
public ConnectionQuery(CustomIPEndPoint responseEndPoint) : base(responseEndPoint) { }
public DownloadFileQuery(CustomIPEndPoint responsEndPoint) : base(responsEndPoint) { }
public GetFileNamesQuery(CustomIPEndPoint responseEndPoint) : base(responseEndPoint) { }
public QueryBase(CustomIPEndPoint responsEndPoint) { ResponseEndPoint = responsEndPoint; }