public void Start() { if (!string.IsNullOrWhiteSpace(Ip)) { _receiver = new TcpClientReceiver(Ip, Port); _recvRunner = new ReceiverSourceRunner <IData>(_receiver, this); _autoRepeatRunner = new AutoRepeatRunner(_recvRunner); _autoRepeatRunner.Start(); Runner.ThreadRun(_autoRepeatRunner); } }
public void Start() { if (IsRunning) { Stop(); } if (!string.IsNullOrWhiteSpace(Ip)) { var receiver = new TcpClientReceiver(Ip, Port); var binToStringConverter = new SpecificEndingsBinaryToStringConverter(new string[] { Environment.NewLine }, Encoding.Default); var convertParser = new ConvertParser <IData, string>(this, binToStringConverter); var recvRunner = new ReceiverSourceRunner <IData>(receiver, convertParser); _autoRepeatRunner = new AutoRepeatRunner(recvRunner); _autoRepeatRunner.Start(); Runner.ThreadRun(_autoRepeatRunner); } }