Skip to content

Instantly share code, notes, and snippets.

@scionwest
Created January 25, 2015 02:40
Show Gist options
  • Save scionwest/5e80b8a25cc9ecd92341 to your computer and use it in GitHub Desktop.
Save scionwest/5e80b8a25cc9ecd92341 to your computer and use it in GitHub Desktop.
public void Connect()
{
Thread t = new Thread(DoConnect);
t.IsBackground = true;
t.Start();
}
private void DoConnect()
{
irc = new TcpClient(_server, _port);
stream = irc.GetStream();
reader = new StreamReader(stream);
writer = new StreamWriter(stream);
Listen();
}
private void Listen()
{
while ((inputLine = reader.ReadLine()) != null)
{
writer.WriteLine(message);
writer.Flush();
Console.Write(inputLine);
}//end while
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment