public bool Start()
{
Stop();
try
{
this.tcpClient = new TcpClient(this.hostName, this.port);
//this.tcpClient = new TcpClient();
//this.tcpClient.Connect(this.hostName, this.port);
this.networkStream = tcpClient.GetStream();
this.winLircTread = new Thread(new ThreadStart(this.WinLIRCThread));
this.winLircTread.Name = "WinLIRC";
this.winLircTread.IsBackground = true;
this.winLircTread.Start();
return true;
}
catch (ArgumentNullException e)
{
Trace.WriteLineIf(MainForm.trace.TraceError, string.Format("ArgumentNullException: {0}", e));
}
catch (SocketException e)
{
Trace.WriteLineIf(MainForm.trace.TraceError, string.Format("SocketException: {0}", e));
}
return false;
}